karras
karras copied to clipboard
fetch-by-id requires :id to be of type ObjectId
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
Agreed. That procedure is simply an artifact of laziness from using this library on an internal project. I'll clean it up.