Skip to content

Instantly share code, notes, and snippets.

@AlexanderKozhevin
Last active May 22, 2016 18:47
Show Gist options
  • Save AlexanderKozhevin/f74c7338caca7c160dcee86b02872d73 to your computer and use it in GitHub Desktop.
Save AlexanderKozhevin/f74c7338caca7c160dcee86b02872d73 to your computer and use it in GitHub Desktop.
var RecordItem = new Schema({
Email : {type: String},
Key : {type: String},
Username : {type: String},
MPHEmail : {type: String},
API : {type: String},
AccountType : {type: String},
card : {type: String}
});
app.get('/modify' , function(request, response) {
var instance = new MyModel();
var id = request.query.id;
var card = request.query.card;
if (id){
id = id.toString();
}
MyModel.findOne({Key: id}, function (err, doc){
doc.card = card;
doc.save(function(){
response.send('ok');
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment