I have imported my database entries from a csv file into mongodb and in the process of doing so the imported entries's '_id's aren't in the typical randomised format. e.g instead of looking like
"_id": "R6AnePqKecNNe7dkr"
they look like
"_id": 28
For some reason this means that when I try to refer to the database entry with an _id of 28 it can't find it. I thought it might be an issue in that they _id is not a string because they're not in quotes but I've tried to convert them to strings and that doesn't make a difference. I've tried making a function that randomly generates a new _id but it can't find the old _id to put the new _id into.
Is there any way to do a bulk "generate new _ids for everything in this collection"? I'm having trouble finding anything equivalent