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

Method get

packages/firebase-firestore/index.android.ts:471–499  ·  view source on GitHub ↗
(options?: GetOptions)

Source from the content-addressed store, hash-verified

469 }
470
471 get(options?: GetOptions): Promise<QuerySnapshot> {
472 let source: com.google.firebase.firestore.Source;
473 switch (options) {
474 case GetOptions.Cache:
475 source = com.google.firebase.firestore.Source.CACHE;
476 break;
477 case GetOptions.Server:
478 source = com.google.firebase.firestore.Source.SERVER;
479 break;
480 default:
481 source = com.google.firebase.firestore.Source.DEFAULT;
482 break;
483 }
484
485 return new Promise((resolve, reject) => {
486 org.nativescript.firebase.firestore.FirebaseFirestore.Query.get(
487 this.native,
488 source,
489 new org.nativescript.firebase.firestore.FirebaseFirestore.Callback<com.google.firebase.firestore.QuerySnapshot>({
490 onError(error) {
491 reject(FirebaseError.fromNative(error));
492 },
493 onSuccess(ss) {
494 resolve(QuerySnapshot.fromNative(ss));
495 },
496 })
497 );
498 });
499 }
500
501 limit(limit: number) {
502 return Query.fromNative(this.native.limit(limit));

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected