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

Field names with '.' needs some sort of escaping #28

Open
dagolden opened this issue Apr 4, 2013 · 3 comments
Open

Field names with '.' needs some sort of escaping #28

dagolden opened this issue Apr 4, 2013 · 3 comments
Assignees

Comments

@dagolden
Copy link
Contributor

dagolden commented Apr 4, 2013

MongoDB doesn't allow '.' in keys within a hash. This needs to be detected and either get escaped somehow or else a sensible error get thrown.

The problem with escaping is that it makes searches more difficult, but it may be the least worst option.

@rodrigolive
Copy link
Owner

Could you submit a test case?

@dagolden
Copy link
Contributor Author

dagolden commented Apr 5, 2013

This link suggests replacing with Unicode full-width equivalent could be OK: http://docs.mongodb.org/manual/faq/developers/#faq-dollar-sign-escaping

The issue is whether that should be a default behavior or optional. I can't imagine keys having full-width equivalents very often, so it might be a safe and useful default -- but would need to happen in queries as well. Or at least a helper function to escape keys used in queries would let users do it more easily.

@diegok
Copy link
Collaborator

diegok commented Jul 8, 2016

I'll check with the new driver that its yours and will close in some way this issue on a further release that will force the upgrade to the 1.x driver as it was almost a year since I've released the optional support for it 👍

@diegok diegok self-assigned this Jul 8, 2016
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

2 participants