Commit 926b193b authored by Bong Cosca's avatar Bong Cosca
Browse files

Bug fix: MongoId object not preserved

parent 80dbfb52
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -147,21 +147,16 @@ class Mapper extends \DB\Cursor {
				$cursor=$cursor->skip($options['offset']);
			if ($options['group'])
				$tmp->drop();
			$result=iterator_to_array($cursor,FALSE);
			$result=array();
			while ($cursor->hasnext())
				$result[]=$cursor->getnext();
			if ($fw->get('CACHE') && $ttl)
				// Save to cache backend
				$cache->set($hash,$result,$ttl);
		}
		$out=array();
		foreach ($result as &$doc) {
			foreach ($doc as &$val) {
				if (is_array($val))
					$val=json_decode(json_encode($val));
				unset($val);
			}
		foreach ($result as $doc)
			$out[]=$this->factory($doc);
			unset($doc);
		}
		return $out;
	}