@naturalcycles/firestore-lib 2.16.0 → 2.16.1
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/dist/query.util.js +5 -1
- package/package.json +1 -1
- package/src/query.util.ts +5 -1
package/dist/query.util.js
CHANGED
|
@@ -27,7 +27,11 @@ export function dbQueryToFirestoreQuery(dbQuery, emptyQuery) {
|
|
|
27
27
|
q = q.orderBy(mapName(ord.name), ord.descending ? 'desc' : 'asc');
|
|
28
28
|
}
|
|
29
29
|
// limit
|
|
30
|
-
|
|
30
|
+
// Careful here, Firestore just changed the behavior of limit(0) recently!
|
|
31
|
+
// Therefor we're guarding the limit(0) case and not sending the limit if it's zero.
|
|
32
|
+
if (dbQuery._limitValue) {
|
|
33
|
+
q = q.limit(dbQuery._limitValue);
|
|
34
|
+
}
|
|
31
35
|
// selectedFields
|
|
32
36
|
if (dbQuery._selectedFieldNames) {
|
|
33
37
|
// id is filtered out, because in Firestore it's not a "property",
|
package/package.json
CHANGED
package/src/query.util.ts
CHANGED
|
@@ -40,7 +40,11 @@ export function dbQueryToFirestoreQuery<ROW extends ObjectWithId>(
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// limit
|
|
43
|
-
|
|
43
|
+
// Careful here, Firestore just changed the behavior of limit(0) recently!
|
|
44
|
+
// Therefor we're guarding the limit(0) case and not sending the limit if it's zero.
|
|
45
|
+
if (dbQuery._limitValue) {
|
|
46
|
+
q = q.limit(dbQuery._limitValue)
|
|
47
|
+
}
|
|
44
48
|
|
|
45
49
|
// selectedFields
|
|
46
50
|
if (dbQuery._selectedFieldNames) {
|