Closed idenoq closed 14 years ago
I'll have to look into the second case. The first will not be supported since parsing the ObjectId out of the json just isn't worth it.. The equivalent to ObjectId in PHP is MongoId. See http://www.php.net/manual/en/class.mongoid.php
This will work: $loaded_posts = $posts->find(array('_id' => new MongoId("4cb21a15a2749efc83ff831e")));
Thank you very much. I have found the same thing by my self 15min ago :) I have been using your module with ko3 for 3 days and testing performance compared to mysql, I am seriously thinking about using it for production. To all of you wo read this please look into http://www.php.net/manual/en/mongo.types.php. Thanks one more time.
I have been trying to implement query like this: db.posts.find({"_id" : ObjectId("4cb21a15a2749efc83ff831e")}); and I haven't had success. I have tried:
When I create query in database - it works. When I try it in model based on yours it doesn't work. This happens only with native _id and not with other elements of document when I use "find" or "findone"...