fixed filter bug
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
|
|
||||||
type ParsedQuery = Array<
|
type ParsedQuery = Array<
|
||||||
Record<
|
Record<string, Record<"$eq" | "$ne" | "$in" | "$nin", string | Date | Object>>
|
||||||
string,
|
|
||||||
Record<"$eq" | "$neq" | "$in" | "$nin", string | Date | Object>
|
|
||||||
>
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
function convertValue(value: any) {
|
function convertValue(value: any) {
|
||||||
@@ -43,7 +40,7 @@ export function parse(query: string, validFields: Array<string>): ParsedQuery {
|
|||||||
if (char === "=") {
|
if (char === "=") {
|
||||||
op = "$eq";
|
op = "$eq";
|
||||||
} else {
|
} else {
|
||||||
op = "$neq";
|
op = "$ne";
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user