#NEWLINE# def update( self , **update ) : #NEWLINE# #INDENT# '\n        Updates the embedded documents with the given update values.\n\n        .. note::\n            The embedded document changes are not automatically saved\n            to the database after calling this method.\n\n        :param update: A dictionary of update values to apply to each\n         embedded document.\n        :return: The number of entries updated.\n        ' #NEWLINE# if ( len ( update ) == 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# values = list ( self ) #NEWLINE# for item in values : #NEWLINE# #INDENT# for ( k , v ) in update . items ( ) : #NEWLINE# #INDENT# setattr ( item , k , v ) #NEWLINE# #UNINDENT# #UNINDENT# return len ( update )