Closed avalero closed 2 years ago
Testing I discovered the reason is because it expects and _id for any object (document), which should not be required (as it is not required by mongo).
This insertOne
works just fine
{
"name": "Colegio Velazquez",
"address": "Pl. Mayor, 2",
"population": "Madrid",
"phone": "917511520",
"email": "velazquez@gmail.com",
"type":["ACADEMY","CAMPUS"],
"nature": "PUBLIC",
"languages": ["español", "ingles", "aleman"],
"contacts":[{"_id": new ObjectId(), "name":"Pedro", "email":"pedro@gmail.com", "phone":"333333333"}]
}
Closed because I cannot reproduce this with other inputs, there must be something on my input that makes it not work.
Hello, if I try to
insertOne
with this DocumentI get the following error
Inserting that document directly from mongo shell results OK
The error is whith the objects array
contacts
as insertingworks just fine