complete bson recordwriter + output format code