encode MongoCode and MongoBinData