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

Remove schema reserved words #1653

Closed
j opened this issue Aug 19, 2013 · 5 comments
Closed

Remove schema reserved words #1653

j opened this issue Aug 19, 2013 · 5 comments
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Milestone

Comments

@j
Copy link
Contributor

j commented Aug 19, 2013

There has to be a way to not have any reserved words. I'm working with existing data which has "options" as a key. Welp, that happens to be a reserved key in schemas and throws an error for me. Granted, I can probably map this some other way, or if mongoose allowed for field name mapping (which is a separate issue), I feel that the use of the word "option" or "options" is a common word.

Anyway, what do you think?

@j
Copy link
Contributor Author

j commented Aug 19, 2013

After googling, this seems to be an issue for a lot of people, but i feel that it's a quick hacky fix to just throw an error and not allow certain properties.

Users should be able to use things like, "model" or "collection", or "options" if they would like I think. There has to be a way to separate field mapping from schema reserved properties/methods.

@aheckmann
Copy link
Collaborator

Definitely. Needs to wait for v4 though due to user interface impacts.

@j
Copy link
Contributor Author

j commented Aug 19, 2013

Sweet, I'm starting to understand the core, so I'll try to knock out some issues on my free time to help you out.

@aheckmann
Copy link
Collaborator

Awesome!

@vkarpov15 vkarpov15 removed this from the 4.0 milestone Jan 30, 2015
@hasezoey
Copy link
Collaborator

hasezoey commented Aug 5, 2022

This issue is basically a duplicate (of the later) #9010, which was fixed by #10414, which was released in 6.0.0 (or 6.0.0-rc2).

The mentioned PR "only" changed that the reserved keywords are not a error anymore, but a warning, but should still resolve this issue.

I think this can be closed @vkarpov15 , @IslandRhythms @Uzlopak

PS: this issue should also maybe be added to the correct milestone, if closed

@Uzlopak Uzlopak added this to the 6.0.0-rc2 milestone Aug 5, 2022
@Uzlopak Uzlopak closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Projects
None yet
Development

No branches or pull requests

5 participants