MongoDB: Fix edit operations in select
This commit is contained in:
parent
84e4122225
commit
574c07b8f5
|
@ -177,6 +177,7 @@ if (isset($_GET["mongo"])) {
|
||||||
$class = 'MongoDB\Driver\BulkWrite';
|
$class = 'MongoDB\Driver\BulkWrite';
|
||||||
$bulk = new $class(array());
|
$bulk = new $class(array());
|
||||||
$bulk->delete($where, array('limit' => $limit));
|
$bulk->delete($where, array('limit' => $limit));
|
||||||
|
var_dump($where);
|
||||||
return $connection->executeBulkWrite("$db.$table", $bulk, 'getDeletedCount');
|
return $connection->executeBulkWrite("$db.$table", $bulk, 'getDeletedCount');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,8 +278,7 @@ if (isset($_GET["mongo"])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_query_where_parser($queryWhere) {
|
function sql_query_where_parser($queryWhere) {
|
||||||
$queryWhere = trim(preg_replace('/WHERE[\s]?[(]?\(?/', '', $queryWhere));
|
$queryWhere = preg_replace('~^\sWHERE \(?\(?(.+?)\)?\)?$~', '\1', $queryWhere);
|
||||||
$queryWhere = preg_replace('/\)\)\)$/', ')', $queryWhere);
|
|
||||||
$wheres = explode(' AND ', $queryWhere);
|
$wheres = explode(' AND ', $queryWhere);
|
||||||
$wheresOr = explode(') OR (', $queryWhere);
|
$wheresOr = explode(') OR (', $queryWhere);
|
||||||
$where = array();
|
$where = array();
|
||||||
|
|
Loading…
Reference in a new issue