react-query-firebase 2.6.4 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { and, or, where, FieldPath } from "@react-native-firebase/firestore";
|
|
2
2
|
/**
|
|
3
3
|
* Constructs a composite or where query filter based on the provided query structure.
|
|
4
4
|
* It recursively builds query constraints using logical "or" or "and" operators.
|
|
@@ -39,7 +39,7 @@ export const buildCompositeFilter = (query) => {
|
|
|
39
39
|
return query.operator === "OR" ? or(...queryConstraints) : and(...queryConstraints);
|
|
40
40
|
}
|
|
41
41
|
if (query.field && query.op) {
|
|
42
|
-
return where(query.field === "documentId" ?
|
|
42
|
+
return where(query.field === "documentId" ? new FieldPath("__name__") : query.field, query.op, query.value);
|
|
43
43
|
}
|
|
44
44
|
return null;
|
|
45
45
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FirebaseFirestoreTypes, and, or, where, FieldPath } from "@react-native-firebase/firestore";
|
|
2
2
|
import { AppModel } from "../../../types";
|
|
3
3
|
|
|
4
4
|
export type QueryFilterConstraint =
|
|
@@ -65,7 +65,7 @@ export const buildCompositeFilter = <AppModelType extends AppModel = AppModel>(
|
|
|
65
65
|
|
|
66
66
|
if (query.field && query.op) {
|
|
67
67
|
return where(
|
|
68
|
-
query.field === "documentId" ?
|
|
68
|
+
query.field === "documentId" ? new FieldPath("__name__") : (query.field as string),
|
|
69
69
|
query.op,
|
|
70
70
|
query.value
|
|
71
71
|
) as unknown as FirebaseFirestoreTypes.QueryFilterConstraint;
|