public static findById (mixed $id)
Find a document by its id (_id)
// Find user by using \MongoId object $user = Users::findById(new \MongoId('545eb081631d16153a293a66')); // Find user by using id as sting $user = Users::findById('45cbc4a0e4123f6920000002'); // Validate input if ($user = Users::findById($_POST['id'])) { // ... }
Please login to continue.