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

Rename id in collection to _id #292

Open
codeit-ninja opened this issue Jan 22, 2022 · 2 comments
Open

Rename id in collection to _id #292

codeit-ninja opened this issue Jan 22, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@codeit-ninja
Copy link

codeit-ninja commented Jan 22, 2022

I think it a bit wierd that we cannot use the id field in a collection, it must be a string and cannot be a number.

The explaination as to why is in my opinion a bit wierd.
https://github.com/wovalle/fireorm/blob/master/docgen/Core_Concepts.md

In firestore the id is saved as _id, why not implement it like that? Not be able to use an number as id is pretty inconvenient.

@codeit-ninja codeit-ninja changed the title Rename required id in collection to _id Rename id in collection to _id Jan 22, 2022
@wovalle wovalle added enhancement New feature or request help wanted Extra attention is needed labels Jan 23, 2022
@wovalle
Copy link
Owner

wovalle commented Jan 23, 2022

Hi @redbullzuiper! This was an early design choice made when building this library. Unfortunately to fix it now it'll require refactoring how the Collections and Sub-collections are accessed to which I don't have the required the time now.

Happy to reviewing this if anybody wants to jump in though

@codeit-ninja
Copy link
Author

It will break the code probaly for alot of people, as they are now using the id field in their code. Not sure what the best solution is here.

Interesting to hear what others think about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants