Closed sensorario closed 10 years ago
orm.connect('mysql://user:password@localhost/mydb', function (err, db) { var Users = db.define("users", { id : { type: 'serial'}, email : { type: "text", size: 50 } }) var newRecord = {} newRecord.email = 'my@e.mail' Users.find({email:'my@e.mail'}, function (err, results) { if (results.length == 0) { if (err) { console.log('@Server: user not found') return } } else { console.log('Email: ' + results[0].emai'Email: ' + results[0].emaill) results[0].x = 33 results[0].y = 34 results[0].save(function(err){ if(err) { console.log(err) } console.log('@Server: saved!!!') }) console.log('@Server: user found') } }) })
I see the log "@Server: user found", and "@Server: saved!!!" but database is not really update. What's wrong with me?
Sorry :-/ I forgot x and y in model definition.
I see the log "@Server: user found", and "@Server: saved!!!" but database is not really update. What's wrong with me?