code: def _insert(collection_name, docs, check_keys, flags, opts):
      
      encode = _dict_to_bson  # Make local. Uses extensions.
      if len(docs) == 1:
          encoded = encode(docs[0], check_keys, opts)
          return b"".join([
              b"\x00\x00\x00\x00",  # Flags don't matter for one doc.
              _make_c_string(collection_name),
              encoded]), len(encoded)
  
      encoded = [encode(doc, check_keys, opts) for doc in docs]
      if not encoded:
          raise InvalidOperation("cannot do an empty bulk insert")
      return b"".join([
          _pack_int(flags),
          _make_c_string(collection_name),
          b"".join(encoded)]), max(map(len, encoded))
docs: Get an OP_INSERT message