Monday, February 13, 2017

How to fetch record by id in mongodb.

$result=$this->mongo_db->where(array('_id' => new MongoId($id)))->get('users');
return $result;

Note : Here users is a collections.

No comments:

Post a Comment