writeObjectSafe

abstract fun <T> writeObjectSafe(obj: T)(source)

Writes an arbitrary obj into a BSON document.

All nested values are escaped as necessary such that the result is a completely inert BSON document.