Hello, I’m working on a mongodb Realm app on Atlas. (Web SDK).
I’m trying to save an object containing on ObjectId with collection.insertOne(myObject)
But insertOne always returns “InvalidParameter Error”
If I save the myObject without the ObjectId, it works properly.
What I want to achieve is to copy entry._id (which is an ObjectId) into entryCopy.
How can I make this work ?
import { ObjectId } from "bson";
entry = {
_id: (ObjectId generated by mongodb Atlas)
field1: value1,
field2: value2,
}
entryCopy = {
_id: (ObjectId will be generated by mongodb Atlas)
field1: value1,
field2: value2,
originalEntryId: new ObjectId(entry._id.id),
}