Skip to content

Commit 4b7389b

Browse files
committed
fix(firestore): handle non array values for where query array-contains
1 parent b00d4fc commit 4b7389b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/firebase-firestore/index.ios.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,9 @@ export class Query<T extends DocumentData = DocumentData> implements IQuery<T> {
568568
case 'array-contains':
569569
query = this.native.queryWhereFieldPathArrayContains(
570570
fieldPath.native,
571-
value.map((val) => {
571+
Array.isArray(value) ? value.map((val) => {
572572
return val?.native || val;
573-
})
573+
}) : value
574574
);
575575
break;
576576
case 'array-contains-any':
@@ -629,9 +629,9 @@ export class Query<T extends DocumentData = DocumentData> implements IQuery<T> {
629629
case 'array-contains-any':
630630
query = this.native.queryWhereFieldArrayContainsAny(
631631
fieldPath as any,
632-
value.map((val) => {
632+
Array.isArray(value) ? value.map((val) => {
633633
return val?.native || val;
634-
})
634+
}) : value
635635
);
636636
break;
637637
case 'in':

packages/firebase-firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/firebase-firestore",
3-
"version": "1.0.0-alpha.14",
3+
"version": "1.0.0-alpha.15",
44
"description": "NativeScript Firebase - Firestore",
55
"main": "index",
66
"typings": "index.d.ts",

0 commit comments

Comments
 (0)