I am new to MongoDB and want to serialize my object efficiently. That means when updating an object i want only to write the fields that changed. If my object has sub objects in a list, i only want to add or remove the changed sub objects. That is because if i have a post with 1000 comments i want to avoid to serialize the whole object each time a new post comes around.
all i found is the convention ignoreifempty, ignoreisdefault and the shouldserializexyz pattern.
is it possible to write a convention like ignoreifnotchanged (i track the dirty fields in my objects) or is there a more general shouldserializexyz because i don't want to write the method for every property.