$mongodb = \Mongo_Db::instance('default');
$mongodb->where(array('_id' => '4ed5dd5e76621f7758000000'));
$result = $mongodb->get('things');
Log::debug('Found this thing: ' . print_r($result, true));
public function where($wheres = array())
{
foreach ($wheres as $wh => $val)
{
Log::debug("WHERE: $wh => $val");
if($wh == '_id')
{
$this->wheres[$wh] = new \MongoId($val);
} else
{
$this->wheres[$wh] = (string) $val;
}
}
return $this;
}
Harro Verton wrote on Wednesday 21st of December 2011:On which version of FuelPHP are you? This has been corrected some time ago. https://github.com/fuel/core/blob/1.1/develop/classes/mongo/db.php#L296
$mongodb->where(array('_id' => '4ed5dd5e76621f7758000000'));
$mongodb->where(array('_id' => new \MongoId('4ed5dd5e76621f7758000000')));
It looks like you're new here. If you want to get involved, click one of these buttons!