Import collection from JSON and convert _Id from String to ObjectId
Answered
Hi, I'm trying to import a collection from a JSON text file.
The problem is that the _id does not have a specific type in the JSON, and gets imported as a normal string. However, I need it to be an ObjectId. Is there a way to configure the import to automatically assign a desired type, or is there a query I could run afterwards to make the conversion?
NoSQLBooster provides generated import script that you can modify and customize it to suit your needs.
1. Click "Preview" button in the import dialog.
2. Press "Alt+Shift+0" or select "Fold->Unfold all" in the context menu to unfold all editor script.
3. Go to line 37
NoSQLBooster provides generated import script that you can modify and customize it to suit your needs.
1. Click "Preview" button in the import dialog.
2. Press "Alt+Shift+0" or select "Fold->Unfold all" in the context menu to unfold all editor script.
3. Go to line 37
Replies have been locked on this page!