(options?: GetOptions)
| 418 | } |
| 419 | |
| 420 | get(options?: GetOptions): Promise<QuerySnapshot> { |
| 421 | let source: FIRFirestoreSource; |
| 422 | switch (options) { |
| 423 | case GetOptions.Cache: |
| 424 | source = FIRFirestoreSource.Cache; |
| 425 | break; |
| 426 | case GetOptions.Server: |
| 427 | source = FIRFirestoreSource.Server; |
| 428 | break; |
| 429 | default: |
| 430 | source = FIRFirestoreSource.Default; |
| 431 | break; |
| 432 | } |
| 433 | |
| 434 | return new Promise((resolve, reject) => { |
| 435 | this.native.getDocumentsWithSourceCompletion(source, (snap, error) => { |
| 436 | if (error) { |
| 437 | reject(FirebaseError.fromNative(error)); |
| 438 | } else { |
| 439 | resolve(QuerySnapshot.fromNative(snap)); |
| 440 | } |
| 441 | }); |
| 442 | }); |
| 443 | } |
| 444 | |
| 445 | limit(limit: number) { |
| 446 | return Query.fromNative(this.native.queryLimitedTo(limit)); |
nothing calls this directly
no test coverage detected