this is my schema
name : String, phone : String, address : String
mongoose.model("user",userSchema);
var user = mongoose.model("user");
var newUser = new user({name : "d",phone : "p",address : "q"}); newUser.save();
newUser.findOne({_id : "dsklfj98908"},function(err,result){
result.set('unlockGames',"puzzle",[String],{strict : false});
result.save();
});
working wonderful,until i want to change one more time:
//NOT WORKING 1 newUser.findOne({_id : "dsklfj98908"},function(err,result){
result.get("unlockGames").push("Gag jan stees");
result.save();
});
//NOT WORKING 2 newUser.findOne({_id : "dsklfj98908"},function(err,result){
var unlockGames = result.get("unlockGames").push("Gag jan stees");
result.set('unlockGames',unlockGames,[String],{strict : false});
result.save();
});
Help please!)