Reads and writes BSON documents to and from Streams and Bufs.
Pretty prints MongoDB documents to a JSON-esque string. Useful for debugging.
Note PrettyPrinter only pretty prints if the resulting text string if greater than
maxWidth. So if
PrettyPrinterappears not to be working, then try setting a smaller
str := BsonIO.print(doc, 20)
indentto 2 spaces.
Reads a BSON document from an
BINARYobjects with a subtype of
BIN_GENERICare returned as a
CODEobjects are returned as
INTEGER_32values are returned as 64-bit
REGEXflags are converted to embedded character flags.
- Deprecated BSON objects are returned as
DATEobjects are returned in the given
This does not change the instant in the date time continuum, just time zone it is reported in. This lets a stored date time of
12 Dec 2012 18:00 UTCbe returned as
12 Dec 2012 13:00 New_York.
Writes the BSON document to a Buf.
As per BSON spec, the returned
Bufis set to be little endian.