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

fetch-by-id requires :id to be of type ObjectId #7

Open
scotthernandez opened this issue Sep 17, 2011 · 1 comment
Open

fetch-by-id requires :id to be of type ObjectId #7

scotthernandez opened this issue Sep 17, 2011 · 1 comment

Comments

@scotthernandez
Copy link

If I'm reading this code correctly, and it is very possible I am not... It seems like a limitation if you store other types of values in your _id field. It is best not to make assumptions like this about types; it is also good not to coerce strings -> ObjectId as you have a chance of missing valid string values. If you really must do this at least check to see if the string is a valid ObjectId first.

https://github.com/wilkes/karras/blob/master/src/karras/collection.clj#L170

@wilkes
Copy link
Owner

wilkes commented Sep 19, 2011

Agreed. That procedure is simply an artifact of laziness from using this library on an internal project. I'll clean it up.

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