I have a mongoDB set up like so:
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"
}
}
How do I query for "i-like-turkey-sandwiches", without knowing it's in position 3, and without doing a search of the whole document? I started writing this, but am completely stumped how to do the search...
$cursor = $collection->findOne(array('fieldName' => 'i-like-turkey-sandwiches));