#NEWLINE# def update_one_in_fields( self , obj , fields ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . _coll . update ( { #NEWLINE# #INDENT# '_id' : obj . _id , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# '$set' : fields , #NEWLINE# #UNINDENT# } , upsert = True ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logger . warning ( e . message ) #NEWLINE# logger . warning ( 'can not update document {0} in fields {1}' . format ( self . _id , fields ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True