This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A developer needs to add a 'discount' tag to all products in the Accessories parent category without removing any existing tags. Which update operator should they use?
$set
$push
$addToSet
What happens when a developer runs insertOne() on a collection that doesn't exist yet in Azure DocumentDB?
The operation fails with a 'collection not found' error.
Azure DocumentDB creates the collection automatically and inserts the document.
The document is inserted into a default collection named 'unassigned'.
A query needs to find bikes priced between $1,000 and $4,000 in the 'Mountain Bikes' subcategory. Which operator combination correctly expresses this filter?
{ price: { $gt: 1000, $lt: 4000 }, 'category.name': 'Mountain Bikes' }
{ $or: [{ price: { $gt: 1000 } }, { price: { $lt: 4000 } }, { 'category.name': 'Mountain Bikes' }] }
{ price: { $gt: 1000 }, price: { $lt: 4000 }, 'category.name': 'Mountain Bikes' }
Which aggregation stage joins documents from another collection in the same database?
$unwind
$lookup
$merge
An aggregation pipeline uses $group with _id: '$parentCategory' and a $sum accumulator on the quantity field. What does this pipeline produce?
One document per unique parent category with the total quantity for that category.
One document per input document with the running total of quantities.
A single document with the total quantity across all categories.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?