How to insert documents with wrong value to MongoDB

Viewed 72

I'm trying to insert documents with wrong value to MongoDB with purpose to test PyMongo library.

Here is the screenshot of the document I want to save to my collection. The wrong value is dateOfBirth. I want to make a new document with year 0 (red underlined in image attached), yet it always returns error.

My purpose is to save the document with the wrong value.

enter image description here

Here is the example document equal to image attached above (I've deleted unnecessary rows):

{
    "_id" : ObjectId("606e925e1c41330274706bbc"),
    "CREATED_DATE" : ISODate("2021-04-08T05:19:26.386+07:00"),
    "customer" : {
        "name" : "Customer Name"
        "dateOfBirth" : ISODate("0-12-29T16:19:26.386+07:00"),
        "gender" : "F",
    },
    "UPDATED_DATE" : ISODate("2021-11-10T23:35:23.187+07:00"),
}
0 Answers
Related