code: public String toJson(final JsonWriterSettings writerSettings) {
          return toJson(writerSettings, DBObjectCodec.getDefaultRegistry().get(BasicDBObject.class));
      }
docs: Gets a JSON representation of this document
  
  <p>With the default {@link DBObjectCodec}.</p>
  
  @param writerSettings the json writer settings to use when encoding
  @return a JSON representation of this document
  @throws org.bson.codecs.configuration.CodecConfigurationException if the document contains types not in the default registry