mongodb:db.users.find({“addresses.0.state”:“NY”})用php写的? [关闭]

In learing mongo with php,I have a tiny problem, that is all,any help would be great appreciated!

You need to read this MongoPHPQueries Page and probably before that you need to do as @RocketHazmat said and start with this MongoPHP Tutorial.

But here is something that might help you with the data you are trying to find.

$cursor = $collection->find(array("addressse.0.state" => "NY"));

The above will give you a cursor allowing you to iterate over each record that is returned. Hope this helps.

FYI - You need more than just that line above to get that to work. So follow the links.