I have a document like this
{
"status": {
"current": 0,
"priority": [{
"operationName": "PHOTO",
"status": "WAITING"
},
{
"operationName": "DESIGN",
"status": "NOTARRIVED"
},
{
"operationName": "COLOR_SEPARATION",
"status": "NOTARRIVED"
}]
}
}
and want to query on data like this
{
"status.priority.$status.current.operationName": {
$in: ['SERVICES', 'PHOTO']
}
}
when I query like this
{
"status.priority.0.operationName": {
$in: ['SERVICES', 'PHOTO']
}
}
it returns the data needed as the 'PHOTO' is the current operation.
I need to query based on an index of the array and this index is stored in the document in status.current
any hint?
UPDATE After question solved I want to optimize it.
"status.priority.3.operationName"