← All MongoDB Flashcard Decks

MongoDB CRUD Operations Flashcards

6 cards from real MongoDB practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 MongoDB CRUD Operations flashcards as text
  1. Which method is used to insert a single document into a MongoDB collection?

    Answer: insertOne()

    insertOne() inserts a single document into a collection and returns an acknowledgment with the inserted document's _id.

  2. What does the findOne() method return when no matching document is found?

    Answer: null

    findOne() returns null when no document matches the specified query filter.

  3. Which update operator sets the value of a field in a document?

    Answer: $set

    $set assigns a new value to the specified field, creating it if it does not already exist.

  4. What option must be passed to updateOne() to create a new document if no match is found?

    Answer: { upsert: true }

    Setting upsert: true causes MongoDB to insert a new document when no document matches the filter criteria.

  5. Which method removes a single document that matches the filter from a collection?

    Answer: deleteOne()

    deleteOne() deletes the first document that matches the filter, returning the count of deleted documents.

  6. What does the $inc operator do in an update operation?

    Answer: Increments or decrements a numeric field by a specified amount

    $inc adds the specified value to a field's current value, and a negative value effectively decrements it.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. 10geneducation.zendesk.com — Test dates, score release, passing score, test delivery, retake policy · verified Oct 2026
  2. learn.mongodb.com — Eligibility, fees, exam format, time limit · verified Oct 2026