Closed Zopenzop closed 1 year ago
The code seems to be correct, I tried in my environment and it works. From the message error it seems that you are supplying an ObjectId value when the system is expecting a String. As you have no ObjectIds in your document, I guess it could only be the "_id" field. If you not specify it, the driver assumes an ObjectId value by default. MongoDb allows to use "_id" fields of different types in the same document, so my suspect is that you have in place a schema that is restricting the "_id" field to be a String. Let me know if you got the problem.
I close this issue, feel free to reopen it if needed.
Tested the same piece of code after a long time and surprisingly, it's working just fine now! Without a single change!
I am trying to insert a document into my Mongo Database using this package.
Here's my code -
I get a runtime error on line 4
Unhandled Exception: type 'ObjectId' is not a subtype of type 'String' of 'value'
Is it an issue with the package or is something wrong with my code?