1. When more than one user works on a document(e.g. cms that allows a user to create custom HTML pages), the information from the first person is
deleted since the second person has not refreshed their browser which results in the users over writing each others changes.
if (pageBody) {
var book= new Book(pageBody);
_.extend(book, pageBody); // Am not too sure if the extend function here is working as it should
Book.findById(book._id, function(err, model) {
if (err) {
cb(err);
} else if (model) {
model.save(function(err, item) {
console.log('--------------------------------------------------------------------');
console.log(item);// The logs show the current info without the __v changing from 0
if (err) {
cb(err);
} else {
cb();
}
});
}
});
} else {
cb();
}