Title: Proposal: Optionally return a document ID on valueChanges() · Issue #1973 · angular/angularfire · GitHub
Open Graph Title: Proposal: Optionally return a document ID on valueChanges() · Issue #1973 · angular/angularfire
X Title: Proposal: Optionally return a document ID on valueChanges() · Issue #1973 · angular/angularfire
Description: A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional withId argument to collection.valueChanges(). This can be a simple non-breaking change and I can PR it. collect...
Open Graph Description: A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional withId argument to collection.valueChanges(). This can be a simple non-...
X Description: A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional withId argument to collection.valueChanges(). This can be a simple non-...
Opengraph URL: https://github.com/angular/angularfire/issues/1973
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Optionally return a document ID on valueChanges()","articleBody":"A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional `withId` argument to `collection.valueChanges()`. This can be a simple non-breaking change and I can PR it. \r\n\r\n```js\r\ncollection.valueChanges(withId?: string)\r\n\r\n// emits [ { myIdKey: 'MrfFpRBfWLTd7LqiTt9u', ...data }, ... ]\r\n```\r\n\r\nThis will greatly simplify the code below\r\n\r\n```js\r\n// current requirement\r\nref.snapshotChanges()\r\n .pipe(\r\n map(actions =\u003e {\r\n return actions.map(a =\u003e {\r\n const data = a.payload.doc.data();\r\n const id = a.payload.doc.id;\r\n return { myIdKey: id, ...data };\r\n });\r\n})\r\n\r\n// after change \r\n\r\nref.valueChanges('myIDKey')\r\n```","author":{"url":"https://github.com/codediodeio","@type":"Person","name":"codediodeio"},"datePublished":"2018-12-14T23:11:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1973/angularfire/issues/1973"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:50472f7d-55b9-422a-08d8-9d38ee03715e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2F8:179BE3:8637FA8:B68114C:6A5E7857 |
| html-safe-nonce | 0f2ec48b8888827fafc874ee43d694a160c10c624cd5ed9d1c2b81cfa47a91ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkY4OjE3OUJFMzo4NjM3RkE4OkI2ODExNEM6NkE1RTc4NTciLCJ2aXNpdG9yX2lkIjoiNDkwNzM4OTMyMDUxMjQ1MTQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4d9a9fd43036b95880f8caa3460fdac4005d6220619fbaa1a79d8a1fc0b3f7d0 |
| hovercard-subject-tag | issue:391309731 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/1973/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6e12ab616d4a3c9b43677ecf3ff0a16256e1d7ca19870d7e8a237b9ede07bfd8/angular/angularfire/issues/1973 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6e12ab616d4a3c9b43677ecf3ff0a16256e1d7ca19870d7e8a237b9ede07bfd8/angular/angularfire/issues/1973 |
| og:image:alt | A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional withId argument to collection.valueChanges(). This can be a simple non-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | codediodeio |
| hostname | github.com |
| expected-hostname | github.com |
| None | 71950bbe6bf7e15662b868c102fed9d1682c29a05970d9b2daa2e4dd3522c52e |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7514606601325843bc1c464d2d8bf5fe9af2c154 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width