How to get document by nested value such as "brand" or "storageId" from "trigger.value".
{
"_id": "60aee243fff5082ca6fba951",
"status": "Good",
"trigger": {
"value": "{"brand":"A","storageId":"2","emplId":"3"}"
}
}
How to get document by nested value such as "brand" or "storageId" from "trigger.value".
{
"_id": "60aee243fff5082ca6fba951",
"status": "Good",
"trigger": {
"value": "{"brand":"A","storageId":"2","emplId":"3"}"
}
}
This should do the trick
db.collection.find({"trigger.value.brand":"A"})
You could add more columns by CSV. This practice is known as dot notations. More on this here