Skip to content
BigBoxCode
  • Home
  • Fundamental
    • Design Patterns
    • Design Principles
    • Data Structures
  • Programming
    • JavaScript Programming
    • Laravel Framework
    • Server-Sent Events(SSE)
    • Python Programming
    • PHP Programming
  • Database
    • MySQL
    • Redis
    • MongoDB
  • DevOps
    • Linux Fundamentals
    • Linux Commands
    • Docker
  • All Tutorials

MongoDB Method

MongoDB Method: db.collection.aggregate()

July 8, 2024March 19, 2024 by BigBoxCode

Process or calculate aggregated values from a collection or view. The processing steps are mentioned in different stages. We can perform operations like grouping, filtering, and/or any general calculation using the aggregation pipeline.

Categories MongoDB Tags MongoDB Aggregate Method, MongoDB Method Leave a comment

MongoDB Method: db.collection.getIndexes()

July 8, 2024March 13, 2024 by BigBoxCode

Get full information on all existing indexes of a collection. Hidden indexes are also included in the result of this method.

Categories MongoDB Tags MongoDB Index Method, MongoDB Method Leave a comment

MongoDB Method: db.collection.createIndex()

July 8, 2024March 10, 2024 by BigBoxCode

Create an index on a collection. We can set index based on fields, and also can set index with specific name.

Categories MongoDB Tags MongoDB Index Method, MongoDB Method Leave a comment

MongoDB Method: db.collection.deleteOne()

July 8, 2024February 29, 2024 by BigBoxCode

Delete a single document. We can select document(s) by filter and delete the first one using this method. If multiple documents match the filter criteria, then the first one will be deleted.

Categories MongoDB Tags MongoDB Delete Method, MongoDB Method Leave a comment

MongoDB Method: db.collection.updateMany()

July 8, 2024February 24, 2024 by BigBoxCode

Update/modify multiple documents of a collection. The documents are select by using a filter, and all the documents matching the criteria are updated by this method. updateMany() will update all the documents matching the filter criteria.

Categories MongoDB Tags MongoDB Method, MongoDB Update Method Leave a comment

MongoDB Method: db.collection.updateOne()

July 12, 2024February 19, 2024 by BigBoxCode

Update/modify a single existing document in a collection. The selection of the document is done by using some filters. If the collection does not already exist, then we have pass “upsert” option, if we want to create a new document.

Categories MongoDB Tags MongoDB Method, MongoDB Update Method Leave a comment

MongoDB Method: db.collection.insertMany()

July 8, 2024February 16, 2024 by BigBoxCode

Insert multiple documents to collection. We provide an array of documents, and each of those documents are added to the collection.

Categories MongoDB Tags MongoDB Method, MongoDB Write Method Leave a comment

MongoDB Method: db.collection.insertOne()

July 8, 2024February 10, 2024 by BigBoxCode

Insert one document to collection. This command is recommended if we just need to add only one document. If the collection does not already exist, then a collection will be created first when we apply this insertOne() method.

Categories MongoDB Tags MongoDB Method, MongoDB Write Method Leave a comment

MongoDB Method: db.collection.findOne()

July 8, 2024February 3, 2024 by BigBoxCode

Find the first document in a specific collection or view, that matches the provided filter. We get a single document that fulfills the criteria. If the provided criteria match multiple documents in the collection/view, then this command returns the first document.

Categories MongoDB Tags MongoDB Method, MongoDB Read Method Leave a comment

MongoDB Method: db.collection.find()

July 8, 2024January 18, 2024 by BigBoxCode

Find documents in a specific collection or a view. We can retrieve multiple documents from a collection(or view), based on some filters. This command returns a cursor, we can iterate over the items using the cursor.

Categories MongoDB Tags MongoDB Method, MongoDB Read Method Leave a comment
  • Tutorials
  • Design Patterns [classic/core patterns for OOP]
  • Design Principles
  • Data Structures
  • Server-Sent Events(SSE)
  • MySQL Tutorials
  • Redis Tutorials
  • MongoDB Tutorials
  • JavaScript Programming
  • PHP Programming
  • Laravel Framework
  • Python Programming

Sponsors

  • About
  • Contact
  • Privacy Policy
  • Disclaimer
  • All Tutorials
  • Sitemap
  • Resources
  • RSS Feed
  • GitHub
  • Linkedin
  • Youtube
© 2025 BigBoxCode