Open cmfunc opened 3 years ago
Op.Data
was added first, it is your MongoDB data as a go map. Later, Op.Doc
was added so that the type could be changed to interface{}
. This allows one to do custom unmarshalling into your own struct.
https://github.com/rwynn/gtm#custom-unmarshalling
If you don't do any custom unmarshalling into your own struct, then both fields get the go map.
I want to get latest document that have been change. for example, in "lessons" mongo collections, I update "$unset" the "room_id" filed of "lessons" collections , I need the doc data without "room_id" field. I shouled select Op.Data and Op.Doc ? Op.Doc is value of Op.Data field "Doc" ?