Method Standards.BSON.encode() Method encode string encode(array|mapping m, int|void query_mode) Description Encode a data structure as a BSON document. Parameter query_mode if set to true, encoding will allow "$" and "." in key names, which would normally be disallowed.