Skip to content
Singhak
  • Home
  • Tech
    • Javascript
    • Python
    • QnA
    • TipsnTricks
    • Automation
  • Blog
  • Submit Guest Post
  • About me
    • Contact Us
    • Privacy Policy
Menu Close
  • Home
  • Tech
    • Javascript
    • Python
    • QnA
    • TipsnTricks
    • Automation
  • Blog
  • Submit Guest Post
  • About me
    • Contact Us
    • Privacy Policy

mongodb

Home » mongodb
Read more about the article How to Update Multiple Array Elements in mongodb
Database / MongoDB

How to Update Multiple Array Elements in mongodb

Suppose we have collection of documents having array and we want to update document having array on the basis of some condition. Insert document in movies collection db.movies.insertMany([ { title:…

0 Comments
23rd January 2023
Read more about the article mongo.exe not installed in Version 6.0.0+ | mongo not a recognize an internal or external command
Database / MongoDB

mongo.exe not installed in Version 6.0.0+ | mongo not a recognize an internal or external command

The legacy mongo shell is no longer included in server packages as of MongoDB 6.0. mongo has been superseded by the new MongoDB Shell (mongosh) which is available separately: Download and Install mongosh The MongoDB Compass admin…

0 Comments
16th January 2023
Read more about the article How to get random record from MongoDB
Database / MongoDB

How to get random record from MongoDB

Radom data is useful to test many scenarios and check our code stability in many ways. We can get random documents from given collection. Solution 1: Using $sample Randomly selects…

0 Comments
26th December 2022
Read more about the article How to get the last N records in mongodb
Database / MongoDB

How to get the last N records in mongodb

We can use various approaches to get the last n record from database. Let find out which approach suits you. You can use combination of the  sort() , limit() ,skip() to get the…

0 Comments
19th December 2022
Read more about the article Get distinct value from mongo DB
Database / MongoDB

Get distinct value from mongo DB

We have various ways to achieve the result. However, we will discuss here two methods. 1. Distinct db.collection.distinct(field, query, options) Finds the distinct values for a specified field across a…

0 Comments
17th October 2022
Read more about the article Add createdAt and updatedAt in mongoose schema using timstamps | Mongoose Timestamp
Database / MongoDB / TipsnTricks

Add createdAt and updatedAt in mongoose schema using timstamps | Mongoose Timestamp

Mongoose schemas support a timestamps option. If you set timestamps: true, Mongoose will add two properties of type Date to your schema: createdAt: a date representing when this document was createdupdatedAt: a date representing when…

0 Comments
13th June 2022
Read more about the article MongoDB query where array length is greater than ‘n’
Database / MongoDB / TipsnTricks

MongoDB query where array length is greater than ‘n’

While working on any project where we may have a requirement to check the size of an array or to get an element whose size is greater or less than…

0 Comments
13th December 2021
Read more about the article Uncaught exception: Error: Updating user failed: User not found
Database / MongoDB / TipsnTricks

Uncaught exception: Error: Updating user failed: User not found

Some time while performing any operation on user like updating user, dropping user or granting or revoking access, we face error like user not found for particular db. Few thing…

0 Comments
6th December 2021
  • 1
  • 2
  • Go to the next page

Buy Me a Coffee

Follow Us

Join Telegram Channel

Categories

Archives

Subscribe

Recent Posts

  • 10 MongoDB performance tuning tips for large scale applications
  • Python utility scripts that can automate various tasks
  • Setting up a MongoDB environment: A step-by-step guide for installing MongoDB on your local machine
  • 5 Different ways to compress image using python script.
  • Make rest api call using https node module.

Menu

  • Home
  • Submit Post
  • Privacy Policy
  • About me
  • Guest Post Submission
  • Contact Us
Support Me

Buy Me a Coffee

Copyright 2021 - Singhak
pixel