Complete the code to find all documents in the 'users' collection using mongos.
db.users.[1]()The find() method retrieves documents from a collection. Mongos routes this query to the correct shards.
Complete the code to insert a document into the 'orders' collection via mongos.
db.orders.[1]({"item": "book", "qty": 3})
The insertOne() method adds a single document. Mongos routes the insert to the correct shard based on the shard key.
Fix the error in the query to update the quantity of an order via mongos.
db.orders.updateOne({"item": "book"}, {$set: [1])The update document must be a valid object. {"qty": 5} is the correct syntax inside $set.
Fill both blanks to query documents where the shard key 'userId' equals 12345.
db.users.find([1]: [2])
The query must use the shard key field name as a string and the value to match. Here, "userId" and 12345 are correct.
Fill all three blanks to update the 'status' field to 'shipped' for order with orderId 67890 via mongos.
db.orders.updateOne([1]: [2], {$set: [3]: "shipped"}})
The filter uses "orderId" and 67890. The update sets the "status" field to 'shipped'.