public class OpMsg extends WireProtocolMessage
see https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.rst

OP_MSG { MsgHeader header; // standard message header uint32 flagBits; // message flags Sections[] sections; // data sections optional checksum; // optional CRC-32C checksum }

struct MsgHeader { int32 messageLength; // total message size, including this int32 requestID; // identifier for this message int32 responseTo; // requestID from the original request // (used in responses from db) int32 opCode; // request type - see table below for details }

section type 0 (BASIC): byte 0; BSON-Document

section type 1 (optimized): byte 1; int32 size CString sequence id; //reference to insert, id is "documents"/ to update id "updates", to delete id is "deletes" BSON-Documents

BSON-Document e.g: {insert: "test_coll", $db: "db", documents: [{_id: 1}]}