/**
* Filter by id
*
* @param string|\MongoId $id id of document
* @return \Sokil\Mongo\Cursor
*/
public function byId($id)
{
if ($id instanceof \MongoId) {
$this->expression->where('_id', $id);
} else {
try {
$this->expression->where('_id', new \MongoId($id));
} catch (\MongoException $e) {
$this->expression->where('_id', $id);
}
}
return $this;
}