convert to base64 image online code example
Example: converting image to base64 string
router.post('/upload',function(req,res){
var base64ToBuffer = new Buffer(req.image, 'base64');//Convert to base64
//Write your insertcode of MongoDb
res.end("Image uploaded Successfully");
});