public function token($token) { $id = Model::factory('v1_tokens')->user($token); if ($id) { self::$user_id = MDB::objectId($id); return $this->get(); } }
public function action_find() { MDB::$config = Kohana::$config->load('database')->mongo; $id = '4f645e4f6e3d1c284e000001'; $id = MDB::objectId($id); MDB::collection('users'); $find = MDB::find($id); d::v(iterator_to_array($find)); }
public function remove($user, $id) { $remove = MDB::objectId($id); $remove['user_id'] = MDB::stringId($user); $x = $this->collection->remove($remove, array('safe' => true)); if ($x['n']) { return $id; } }