I am new with mongo.
I try to get a subDocument of a document, here is my document :
{
"_id" : ObjectId("5900ab35c720b210c000032c"),
"name" : "B 1",
"providers" : [
{
"id" : ObjectId("59030550c720b211dc005e9e"),
"name" : "F 1"
},
{
"id" : ObjectId("59030577c720b211dc005e9f"),
"name" : "F 2"
}
]
}
and I want to get this subDocument :
{
"id" : ObjectId("59030577c720b211dc005e9f"),
"name" : "F 2"
}
I think I need to use these class : http://php.net/manual/en/mongocollection.aggregate.php but I didn't manage to use it with my manager instance of the class : http://php.net/manual/en/class.mongodb-driver-manager.php.
The PHP Manual do not show how to use it with the new Driver.
Can someone help me?
Thank you and Good Day !