I have documents that look like this:
{
"_id":"5883d55ee4b05d652e466108",
"result":"FAILURE",
"failureCauses":[
{
"failureCause":
{
"$ref":"failureCauses",
"$id":"5883d33de4b05d652e4660d4",
"$db":""
},
"indications": [
{
"pattern":"^FATAL: .*$",
"matchingFile":"log",
"matchingString":"FATAL: all hosts have already failed -- aborting"
}
]
},
{
"failureCause":
{
"$ref":"failureCauses",
"$id":"5883d33de4b05d652e4660e3",
"$db":""
},
"indications":[
{
"pattern":".*command not found.*",
"matchingFile":"log",
"matchingString":"bash: rsync: command not found"
}
]
}
]
}
How do I get all documents which have a specific failureCauses array member? (I do have the $id.)
Note, I already tried the queries below but it does not return any results:
{"failureCauses" : new ObjectId("myid") }
{"failureCauses" : { "$in" : [ ObjectId("myid") ]}}