MCPcopy Create free account
hub / github.com/NativeScript/firebase / where

Method where

packages/firebase-firestore/index.ios.ts:507–577  ·  view source on GitHub ↗
(fieldPath: FieldPath | keyof DocumentData, opStr: WhereFilterOp, value: any)

Source from the content-addressed store, hash-verified

505 }
506
507 where(fieldPath: FieldPath | keyof DocumentData, opStr: WhereFilterOp, value: any): Query {
508 let query;
509 if (fieldPath instanceof FieldPath) {
510 switch (opStr) {
511 case '!=':
512 query = this.native.queryWhereFieldPathIsNotEqualTo(fieldPath.native, serializeItems(value));
513 break;
514 case '<':
515 query = this.native.queryWhereFieldPathIsLessThan(fieldPath.native, serializeItems(value));
516 break;
517 case '>':
518 query = this.native.queryWhereFieldPathIsGreaterThan(fieldPath.native, serializeItems(value));
519 break;
520 case '<=':
521 query = this.native.queryWhereFieldPathIsLessThanOrEqualTo(fieldPath.native, serializeItems(value));
522 break;
523 case '>=':
524 query = this.native.queryWhereFieldPathIsGreaterThanOrEqualTo(fieldPath.native, serializeItems(value));
525 break;
526 case '==':
527 query = this.native.queryWhereFieldPathIsEqualTo(fieldPath.native, serializeItems(value));
528 break;
529 case 'array-contains':
530 query = this.native.queryWhereFieldPathArrayContains(fieldPath.native, serializeItems(value));
531 break;
532 case 'array-contains-any':
533 query = this.native.queryWhereFieldPathArrayContainsAny(fieldPath.native, serializeItems(value));
534 break;
535 case 'in':
536 query = this.native.queryWhereFieldPathIn(fieldPath.native, serializeItems(value));
537 break;
538 case 'not-in':
539 query = this.native.queryWhereFieldPathNotIn(fieldPath.native, serializeItems(value));
540 break;
541 }
542 } else {
543 switch (opStr) {
544 case '!=':
545 query = this.native.queryWhereFieldIsNotEqualTo(fieldPath as any, serializeItems(value));
546 break;
547 case '<':
548 query = this.native.queryWhereFieldIsLessThan(fieldPath as any, serializeItems(value));
549 break;
550 case '>':
551 query = this.native.queryWhereFieldIsGreaterThan(fieldPath as any, serializeItems(value));
552 break;
553 case '<=':
554 query = this.native.queryWhereFieldIsLessThanOrEqualTo(fieldPath as any, serializeItems(value));
555 break;
556 case '>=':
557 query = this.native.queryWhereFieldIsGreaterThanOrEqualTo(fieldPath as any, serializeItems(value));
558 break;
559 case '==':
560 query = this.native.queryWhereFieldIsEqualTo(fieldPath as any, serializeItems(value));
561 break;
562 case 'array-contains':
563 query = this.native.queryWhereFieldArrayContains(fieldPath as any, serializeItems(value));
564 break;

Callers

nothing calls this directly

Calls 2

serializeItemsFunction · 0.70
fromNativeMethod · 0.45

Tested by

no test coverage detected