I have a collection called collectionA that contains an array of type objects.
Example:
{
"_id" : ObjectId("123456"),
"tags" : [
{
"name" : "Bob D",
},
{
"name" : "another name",
}
...
How would I write a query that matches the name within the array of objects?
I've tried db.getCollection('collectionA').find({ "name": "Bob D}) but that didn't work.
db.getCollection('collectionA').find({ "tags.name": "Bob D" })sincenameis nested insidetags