Node version: 0.10.25
orm version: 2.1.14
mysql version: 2.3.0
Reproduce of the bug:
Create a model that has a key with mapsTo enable, e.g.
var Model = db.define('model', {
name: String,
remapKey: { type: "integer", mapsTo: "remap_key", key: true }
});;
Later, when save an item that is gotten from Model.find(),
modelObject.name = "another value";
modelObject.save(function (err) {
if (err) throw err;
cb();
}
it will throw an error on mysql level, error message as follow
ER_BAD_FIELD_ERROR: Unknown column 'remapKey' in 'where clause'
Could you please help on fixing this?
Updated on 11:06 am Monday, 26 May, 2014 (GMT)
P.S. The error "ER_BAD_FIELD_ERROR" is gone when I define my model like this
var Model = db.define('model', {
name: String,
remapKey: { type: "integer", mapsTo: "remap_key" }
}, {
id: "remap_key"
});;
But the update is not success as I lookup the query, it says
UPDATE `model` SET `name` = \'another value\', `remap_key` = 1 WHERE `remap_key` IS NULL
Node version: 0.10.25
orm version: 2.1.14
mysql version: 2.3.0
Reproduce of the bug:
Create a model that has a key with mapsTo enable, e.g.
Later, when save an item that is gotten from
Model.find(),it will throw an error on mysql level, error message as follow
Could you please help on fixing this?
Updated on 11:06 am Monday, 26 May, 2014 (GMT)
P.S. The error "ER_BAD_FIELD_ERROR" is gone when I define my model like this
But the update is not success as I lookup the query, it says