I m using MongoDB with PHP s own driver and I have saved multiple arrays under main document. Structure looks like this:
{
_id: 234234234324,
accounts: {
0: {
enabled: 1,
name: asdf
},
1: {
enabled: 0,
name: gfsd
}
}
Accounts are removed and added by the user so I have no control over the array key. I need to somehow get all accounts that have enabled: 1. I tried array("accounts.enabled"=>1) but it doesn t work. And suggestions?