var User = require('../../models/user')
var mongoose = require('mongoose')
module.exports = function (req, res) {
var post = req.body // post.name === new value
User.findById(req.user._id, function (err, user) {
if(err) return console.log(err);
user.data.moneySource[post.index].name = post.name;
user.save(function (err) {
if(err) return console.log(err)
console.log(user.data.moneySource[post.index].name) // it returns NEW value
})
})