All my documents have a structure like this:
{
operational: {availableFleet: [Objectid('5bad3f452641a1186d21b5f8'), ...]}
}
So every document has an operational key with many other keys inside, one of them being availableFleet which is an Array of multiple ObjectIds
I want to retrieve all documents that contain one specific ObjectId inside the availableFleet Array.
Here's my query:
{operational: {availableFleet: {$in: [ObjectId('5bad3f452641a1186d21b5f8')]}}}
However, it's returning nothing.
I'm using the MongoDB Compass GUI.