J'ai un inconnu MongoDB mis en place comme ceci:PHP MongoDB la requête dans un tableau avec une clé
fieldName: {
"1": {
client: "name-here",
subfield: "more-junk-here"
},
"2": {
client: "another-client-name-here",
subfield: "more-data"
},
"3": {
client: "client-num-3",
subfield: "i-like-turkey-sandwiches"
}
}
Comment faire une requête pour "i-like-dinde-sandwichs", sans le savoir est en position 3 , et sans faire une recherche de l'ensemble du document? Je commencé à écrire cela, mais je suis tout à fait perplexe comment faire la recherche ...
$cursor = $collection->findOne(array('fieldName' => 'i-like-turkey-sandwiches));