MCPcopy Index your code
hub / github.com/NativeScript/firebase / where

Method where

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

Source from the content-addressed store, hash-verified

565 }
566
567 where(fieldPath: FieldPath | keyof DocumentData, opStr: WhereFilterOp, value: any): Query {
568 let query;
569 if (fieldPath instanceof FieldPath) {
570 switch (opStr) {
571 case '!=':
572 query = this.native.whereNotEqualTo(fieldPath.native, serializeItems(value));
573 break;
574 case '<':
575 query = this.native.whereLessThan(fieldPath.native, serializeItems(value));
576 break;
577 case '>':
578 query = this.native.whereGreaterThan(fieldPath.native, serializeItems(value));
579 break;
580 case '<=':
581 query = this.native.whereLessThanOrEqualTo(fieldPath.native, serializeItems(value));
582 break;
583 case '>=':
584 query = this.native.whereGreaterThanOrEqualTo(fieldPath.native, serializeItems(value));
585 break;
586 case '==':
587 query = this.native.whereEqualTo(fieldPath.native, serializeItems(value));
588 break;
589 case 'array-contains':
590 query = this.native.whereArrayContains(fieldPath.native, serializeItems(value));
591 break;
592 case 'array-contains-any':
593 query = this.native.whereArrayContainsAny(fieldPath.native, serializeItems(value));
594 break;
595 case 'in':
596 query = this.native.whereIn(fieldPath.native, serializeItems(value));
597 break;
598 case 'not-in':
599 query = this.native.whereNotIn(fieldPath.native, serializeItems(value));
600 break;
601 }
602 } else {
603 switch (opStr) {
604 case '!=':
605 query = this.native.whereNotEqualTo(fieldPath as any, serializeItems(value));
606 break;
607 case '<':
608 query = this.native.whereLessThan(fieldPath as any, serializeItems(value));
609 break;
610 case '>':
611 query = this.native.whereGreaterThan(fieldPath as any, serializeItems(value));
612 break;
613 case '<=':
614 query = this.native.whereLessThanOrEqualTo(fieldPath as any, serializeItems(value));
615 break;
616 case '>=':
617 query = this.native.whereGreaterThanOrEqualTo(fieldPath as any, serializeItems(value));
618 break;
619 case '==':
620 query = this.native.whereEqualTo(fieldPath as any, serializeItems(value));
621 break;
622 case 'array-contains':
623 query = this.native.whereArrayContains(fieldPath as any, serializeItems(value));
624 break;

Callers

nothing calls this directly

Calls 2

serializeItemsFunction · 0.70
fromNativeMethod · 0.45

Tested by

no test coverage detected