You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the id mapped to a single document has also long been a pain point, so we thinking of introducing a new operator to simplify this process:
Collection
// using the new docs property in issue #1819 constitems$=af.collection(‘items’).docs.pipe(unwrapCollection({id: ‘key’})).subscribe(items=>{constfirst=docs[0];console.log(first.key);// they id is mapped to each object!});
Document
// using the .doc property in issue #1819 constitems$=af.collection(‘items/1’).doc.pipe(unwrapDoc({id: ‘key’})).subscribe(item=>{console.log(item.key);});
Leave a comment letting us know what you think.
The text was updated successfully, but these errors were encountered:
Easier access to a document’s ID
Getting the
id
mapped to a single document has also long been a pain point, so we thinking of introducing a new operator to simplify this process:Collection
Document
Leave a comment letting us know what you think.
The text was updated successfully, but these errors were encountered: