I have a mongoDB collection, called myCollection, and inside myCollection there is a structure like this:
{
"id": 1234,
"posts": [
[
{
"id": "0.0",
"name": "john",
"message": "hello"
},
{
"id": "0.1",
"name": "jane",
"message": "good morning"
},
{
"id": "0.2",
"name": "josh",
"message": "good evening"
}
],
[
{
"id": "1.0",
"name": "mark",
"message": "good lunch"
}
],
[
{
"id": "2.0",
"name": "john",
"message": "bye bye"
},
{
"id": "2.1",
"name": "mark",
"message": "hi"
}
]
]
}
Can anyone tell me how I can query this structure to obtain the ENTIRE array that contains a specific object? For example, launching a query around this specific object:
{
"id": "2.0",
"name": "john",
"message": "bye bye"
}
I would to obtain this entire array:
[
{
"id": "2.0",
"name": "john",
"message": "bye bye"
},
{
"id": "2.1",
"name": "mark",
"message": "hi"
}
]