Consider an inventory collection that contains these documents:
{ " _id " : 1, " product " : " x-small box " , " colors " : [ " brown " , " black " , " white " ], " qty " : 50 }
{ " _id " : 2, " product " : " small box " , " colors " : [ " brown " , " white " ], " qty " : 60 }
{ " _id " : 3, " product " : " medium box " , " colors " : [ " black " , " grey " , " white " ], " qty " : 45 }
{ " _id " : 4, " product " : " large box " , " colors " : [ " grey " ], " qty " : 50 }
{ " _id " : 5, " product " : " x-large box " , " colors " : [ " grey " , " white " ], " qty " : 10 }
What result set does the following query return?
db.inventory.find({
$or: [
{ " product " : " x-small box " },
{
$and: [
{ " qty " : { $ne: 50 } },
{ " colors " : { $nin: [ " brown " ] } }
]
}
]
})