Packet types : optional. If specified, a comma-separated list of packet types for which this filter should be called, for instance: INSERT,QUERY. Spaces are ignored. If left blank, this filter will get called for every packet sent to and received from the MongoDB database server.
log : the log object
context : contains all the variables you'll commonly use:
packet : the packet being filtered
phase : a string, either "request" or "response"
result : the result object, used to cancel the current packet if desired
filterContext: an object containing variables attached to this filter. Any changes to this object will be visible to all invocations of this filter.
connectionContext: an object containing variables attached to the database connection. Any changes to this object will be visible to all filters executed for this database connection. In other words, every time a database client opens a new connection to the database, a new connectionContext is created. It is then deleted when that database connection is closed by the client or the server.