def write ( self , value ) : self . get_collection ( ) . update_one ( { '_id' : self . _document_id } , { '$set' : { self . _path : value } } , upsert = True )
python mongodb update a nested field
Write value to the target
def write(self, value):
        """
        Write value to the target
        """
        self.get_collection().update_one(
            {'_id': self._document_id},
            {'$set': {self._path: value}},
            upsert=True
        )