Skip to content

Commit 8753af2

Browse files
authored
Add New MongoDB Index Behavior Question to Quiz (Fixes #5887) (#7237)
* Add Q104: Power Query Editor question to Power BI quiz * Add new MongoDB questions to quiz
1 parent 57497f1 commit 8753af2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

mongodb/mongodb-quiz.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,3 +910,24 @@ _Explanation_ : MongoDB's primary advantage as a NoSQL database over traditional
910910
- [ ] It is a tool for managing database backups
911911
- [x] It is a routing service for sharded clusters
912912
- [ ] It is a tool for importing and exporting data
913+
914+
#### Q116. With regards to indexes, what is the difference between dropping a collection and deleting all documents in a collection?
915+
916+
- [x] drop() removes the collection and indexes; deleteMany({}) removes documents only (indexes remain).
917+
- [ ] drop() removes docs but keeps indexes.
918+
- [ ] Both actions behave the same.
919+
- [ ] deleteMany() also removes indexes automatically.
920+
921+
#### Q117. Which operation invalidates all active cursors on a collection?
922+
923+
- [x] Dropping the collection
924+
- [ ] Running a find() query
925+
- [ ] Creating an index
926+
- [ ] Updating multiple documents
927+
928+
#### Q118. What happens to the _id index when you clone a collection using db.collection.aggregate([{ $out: "newCol" }])?
929+
930+
- [ ] The original _id index is copied exactly.
931+
- [ ] The new collection has no _id index.
932+
- [x] A new _id index is automatically created on newCol.
933+
- [ ] The _id index is created only if explicitly specified.

0 commit comments

Comments
 (0)