Open
Description
It states that it scans all fields that exist, but what I know is that $all checks if all specified array match on the field that is an array
{
--
_id: ObjectId("5234cc89687ea597eabee675"),
code: "xyz",
tags: [ "school", "book", "bag", "headphone", "appliance" ],
qty: [
{ size: "S", num: 10, color: "blue" },
{ size: "M", num: 45, color: "blue" },
{ size: "L", num: 100, color: "green" }
]
}
{ tags: { $all: [ "ssl" , "security" ] } }
the behavior will be like this
{ $and: [ { tags: "ssl" }, { tags: "security" } ] }
But in laravel docs does mongodb $all has another behavior that check each fields( like $exist but in one go without loop)
{ "title": "Cosmos",
"year": 1980,
"runtime": 60,
"imdb": {
"rating": 9.3,
"votes": 17174,
"id": 81846
},
},
//Is this correct, or does mongodb $all has another behavior that check each fields( like $exist but in one go without loop)
$result = DB::table('movies')
->where('movies', 'all', ['title', 'rated', 'imdb.rating'])
->get();