How to write find query in mongo db to select certain values. For example
IN MYSQL - SELECT * from things where id=3;
IN Mongo - thingscollection->find(array("_id" => $id))
suppose if the MYSQL query looks like this,
SELECT name,age from things where id=3;
I am wondering how to write find query in PHP/MongoDB to select specific values?
You may want to use the mongo
_idinstead of an own createdidfield.For more information specifically about the php driver: http://php.net/manual/en/mongo.sqltomongo.php
An other good link for just SQL to Mongo is http://rickosborne.org/download/SQL-to-MongoDB.pdf