fixed filter bug

This commit is contained in:
2025-04-09 14:31:20 +05:30
parent f18af487d7
commit e9bba4bdf5

View File

@@ -1,10 +1,7 @@
import mongoose from "mongoose";
type ParsedQuery = Array<
Record<
string,
Record<"$eq" | "$neq" | "$in" | "$nin", string | Date | Object>
>
Record<string, Record<"$eq" | "$ne" | "$in" | "$nin", string | Date | Object>>
>;
function convertValue(value: any) {
@@ -43,7 +40,7 @@ export function parse(query: string, validFields: Array<string>): ParsedQuery {
if (char === "=") {
op = "$eq";
} else {
op = "$neq";
op = "$ne";
i++;
}