mongo-c-driver icon indicating copy to clipboard operation
mongo-c-driver copied to clipboard

BSON-as-JSON indented output

Open vector-of-bool opened this issue 2 years ago • 0 comments

This changeset adds options to bson_as_json that supports prettier-formatted output. Helpful when debugging differences between large documents side-by-side. These options are only exposed in the private API at the moment. It works like:

  • level_indent - If NULL, all behaves as previously. If not-null, this string is inserted at the beginning of the line N times for a line at depth N.
  • initial_indent - This is inserted before the opening brace.
  • subsequent_indent - This is inserted before the level_indents at the beginning of every line (except for the first line).

(This was useful while debugging csfle oddities.)

vector-of-bool avatar May 06 '22 00:05 vector-of-bool