app.post('/rates_post', function(req, res) {
var rate={
name: req.body.name,
billing_name: req.body.bilname,
cost: req.body.cost
};
MongoClient.connect('mongodb://localhost:27017/', function(err, client) {
if(err) console.log(err);
var coll = client.db('test_base').collection('crowd');
coll.insertOne(rate, function(){
coll.findOne({name: rate.name}, function(err, doc) {
if(err) console.log(err);
client.close();
res.json(doc);
});
});
});
});