Why this error using Firestore get() method? ERROR TypeError: snaps.map is not a function
I am working on an Angular project using Firebase FireStore database and I implemented this method to perform a query:
findArtistBidsAppliedByCurrentWall(bid):Observable<Bid[]> {
console.log("findArtistBidsAppliedByCurrentWall() START")
return this.db.collection('bids',
ref=> ref.where("wallId", "==", bid.wallId))
.get()
.pipe(
map(snaps => {
console.log("TEST");
const bids = this.convertSnaps<Bid>(snaps);
return bids;
})
)
}
NOTE: I have to use get() and not snapshotChanges() in order to not listen to changes.
The problem is that when the previous code is excecuted I obtain the following error message into the browser developer tools:
ERROR TypeError: snaps.map is not a function
convertSnaps notifications.service.ts:185
findArtistBidsAppliedByCurrentWall notifications.service.ts:159
RxJS 4
Angular 6
RxJS 3
Angular 16
RxJS 4
schedule Angular
RxJS 4
Angular 20
node_modules vendor.js:157356
node_modules NextJS
node_modules vendor.js:149711
node_modules vendor.js:149679
Ur index.cjs.js:5711
Us index.cjs.js:11891
step tslib.es6.js:100
verb tslib.es6.js:81
fulfilled tslib.es6.js:71
Angular 13
invoke
run
scheduleResolveOrReject
invokeTask
runTask
drainMicroTaskQueue
invokeTask
invokeTask
globalZoneAwareCallback
customScheduleGlobal
scheduleTask
scheduleTask
scheduleEventTask
core.js:6241:19
Angular 4
RxJS 5
Angular 20
RxJS 12
Angular 6
RxJS 3
Angular 16
RxJS 4
schedule Angular
RxJS 4
why this error? What is wrong? What am I missing?
Source: Angular Questions