MongoDB: Fix executeQuery
This commit is contained in:
parent
f11a31e0a9
commit
c24a6a6aef
|
@ -27,10 +27,10 @@ if (isset($_GET["mongo"])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeQuery($db, $command) {
|
function executeQuery($namespace, $where, $command) {
|
||||||
$class = 'MongoDB\Driver\Query';
|
$class = 'MongoDB\Driver\Query';
|
||||||
try {
|
try {
|
||||||
return $this->_link->executeQuery($db, new $class($command));
|
return $this->_link->executeQuery($namespace, new $class($where, $command));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
return array();
|
return array();
|
||||||
|
@ -136,7 +136,7 @@ if (isset($_GET["mongo"])) {
|
||||||
}
|
}
|
||||||
$limit = min(200, max(1, (int) $limit));
|
$limit = min(200, max(1, (int) $limit));
|
||||||
$skip = $page * $limit;
|
$skip = $page * $limit;
|
||||||
$results = $connection->executeQuery("$connection->_db_name.$table", array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort));
|
$results = $connection->executeQuery("$connection->_db_name.$table", $where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort));
|
||||||
return new Min_Result($results);
|
return new Min_Result($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue