-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Mongoadmin crashes or throws a 404 when you attempt to change a document with an _id that is not an ObjectId. @lbjay tried to fix this problem in the adsabs/mongoadmin repo with code similar to pull request #5. Both branches appear to work when the _id is a string, but they don't work when _id is an integer. I have a database where the _ids are all integers. Mongo supports a wide range of types for _id including floats, ints, strs, bools, ObjectIds, datetimes, and dicts.
I see two ways to fix this:
- Make mongoadmin work when _id is a string, int, or ObjectId, and use some heuristics to distinguish between the cases. The advantage of this is that the urls can stay the same; however, if a database contains both
{_id:10}and{_id:"10"}there will never be a way to distinguish them. - Change the urls to include the json-encoded _id field. This will preserve type information, but make the urls uglier. This will work with almost any valid _id using mongo's extended json.
I'd like to fix it, but I want to figure out the best solution first.
Metadata
Metadata
Assignees
Labels
No labels