MongoDB: Different return values on .find() at shell access, and at php -


i started use mongodb 2.4.4, , have iritating case query-ing post, field in php.

in mongoshell, db.posts.find({page_id:345671} (for example) gives me 293 count of document.

the php equivalent:

$connection = new mongo('mongodb://localhost:27017'); $db = connection->selectdb('post_db'); $posts = $db->posts->find(array('page_id' => 345671)); 

alway return zero, but, when find array empty, gives entire collection.

also, ->explain() , .explain() gaves me different params.

what wrong? there's no sharding, no indexes, test data, i'm in begining of things.

solved, many vitaly muminov! "i'm not quite sure that, can try setting ini_set('mongo.native_long', 1); or wrapping numbers mongoint64 class"

the solution wrap number mongoint64!


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

node.js - Node - Passport Auth - Authed Post Route hangs on form submission -

Does Firefox offer AppleScript support to get URL of windows? -