Skip to content

Commit 9f34be8

Browse files
davideastjamesdaniels
authored andcommitted
feat(firestore): get Observable (angular#1824)
1 parent 76ff6c1 commit 9f34be8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/firestore/collection/collection.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { Observable, Subscriber } from 'rxjs';
1+
import { Observable, from } from 'rxjs';
22
import { fromCollectionRef } from '../observable/fromRef';
33
import { map, filter, scan } from 'rxjs/operators';
4-
5-
import { Injectable } from '@angular/core';
4+
import { firestore } from 'firebase/app';
65

76
import { DocumentChangeType, CollectionReference, Query, DocumentReference, DocumentData, QueryFn, AssociatedReference, DocumentChangeAction, DocumentChange } from '../interfaces';
87
import { docChanges, sortedChanges } from './changes';
@@ -113,6 +112,14 @@ export class AngularFirestoreCollection<T=DocumentData> {
113112
);
114113
}
115114

115+
/**
116+
* Retrieve the results of the query once.
117+
* @param options
118+
*/
119+
get(options: firestore.GetOptions) {
120+
return from(this.query.get(options));
121+
}
122+
116123
/**
117124
* Add data to a collection reference.
118125
*

0 commit comments

Comments
 (0)