Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore collection (mixin) items don't have the $key field (used in dom-repeat) #306

Open
danbaechtold opened this issue Nov 8, 2017 · 7 comments

Comments

@danbaechtold
Copy link

Description

The old database and firebase-query added an extra $key field to every item.
But the new firestore collection (mixin) does not, but instead uses __id__.

Expected outcome

Either keep it the same in both DBs or point out that __id__ can be used, the same way $key is described:
https://www.webcomponents.org/element/firebase/polymerfire/elements/firebase-query

Actual outcome

For now, __id__ has to be used instead of $key (which is fine for me, just need to know).

@merlinnot
Copy link
Contributor

I’m actually considering making a PR to change __id__ to __name__. The latter is used in official firestore docs and implementation.

@danbaechtold
Copy link
Author

I'm fine with both, as long as it is shown and documented.

In Firestore it seems to me that both are beeing used (I think ID is more often used, but NAME is used in security rules on resources..):

@merlinnot
Copy link
Contributor

id is used as a property on snapshots, while __name__ is used when it refers to a property of an entity itself, in security rules as you've mentioned, but also for ordering etc.

Since we use it as a latter, I'd prefer the __name__.

That would be great to have some feedback from the maintainers :) @tjmonsi @mbleigh

@mbleigh
Copy link
Contributor

mbleigh commented Jan 8, 2018 via email

@merlinnot
Copy link
Contributor

Ok, good to know.

@Thkasis
Copy link

Thkasis commented Jan 22, 2018

Sorry guys, just wondering where this firestore mixin is ? I see questions posted about it and discussions but cannot find it in the repo! Cheers

@merlinnot
Copy link
Contributor

https://github.com/firebase/polymerfire/tree/firestore

It's not in the master yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants