When picking out fields for the original object vs updated object, two issues arise when a '$' or '$[]' is present in the update query:
The pick function from lodash doesn't support picking with those updaters, so the original object (dbObject) doesn't find the field leaving the object missing that field.
The updated object (updatedObject) assumes that the key name is '$', and you cannot use '$' as a field name for the log object.
When picking out fields for the original object vs updated object, two issues arise when a '$' or '$[]' is present in the update query:
dbObject
) doesn't find the field leaving the object missing that field.updatedObject
) assumes that the key name is '$', and you cannot use '$' as a field name for the log object.