I write simple app with expressjs and mongoose and I have strange problem.This is part of the code:
db.addOwner = function(obj){
var params = arguments[0],
newOwner = Owner({
firstName: params.firstName,
lastName: params.lastName,
age: params.age
});
newOwner
.save()
.then(console.log);
};
db.addCar = function(obj){
var params = arguments[0],
newCar = Car({
model: params.model,
year: params.year,
hp: params.hp
});
newCar
.save()
.then(console.log);
};
The problem is that db.addOwner work but db.addCar don't.Do you have any ideas how to fix it?