michaelkryukov / mongomock_motor

Library for mocking AsyncIOMotorClient built on top of mongomock.
MIT License
94 stars 23 forks source link

Default Value(0, False, []) is not saved in MongoMock. #52

Closed jaehyoyoo closed 4 months ago

jaehyoyoo commented 4 months ago

Hi, I'm usefully using the mongomock_motor for the unittest of my code. I wonder if there is some option to ignore zero-value during the update | save process. Here is my code. I found that the document for 'session_id' does not have 'container' value.

await self.mongodb_manager_mock.collection.update_one(
    {
        "session_id": "session_id"
    },
    {"$set": {
        "container": []
    }},
)

Is there any solution for the problem?

jaehyoyoo commented 4 months ago

I think it was my fault. Thank you.