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
@@ -74,5 +74,5 @@
74
74
  "docs:build": "vitepress build docs",
75
75
  "docs:preview": "vitepress preview docs"
76
76
  },
77
- "version": "2.6.4"
77
+ "version": "2.6.5"
78
78
  }
@@ -1,4 +1,4 @@
1
- import firebase, { and, or, where } from "@react-native-firebase/firestore";
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" ? firebase.FieldPath.documentId() : query.field, query.op, query.value);
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 firebase, { FirebaseFirestoreTypes, and, or, where } from "@react-native-firebase/firestore";
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" ? firebase.FieldPath.documentId() : (query.field as string),
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;