codeigniter-mongodb-library icon indicating copy to clipboard operation
codeigniter-mongodb-library copied to clipboard

How to take $lte on where with ObjectID

Open infinios opened this issue 2 years ago • 0 comments

I wanted to see the number of objects created before the current _id.

db.CollectionName.find({_id: {$lte: ObjectId('60d72cb1faaeb52ac010d0ed')} }).count() This will tell me how many records are created before this particular record. Any way to do this in this Library.

I am trying $query_count = $this->mongo_db->where("_id", $this->mongo_db->lte($store_id)); but it has an exception only float i can use not ObjectID.

infinios avatar Apr 26 '22 12:04 infinios