Is it possible to do a find then save using async/await promise?
I have the following code:
try {
var accounts = await Account.find()
.where("username").in(["hello@hello.com"])
.exec();
accounts.push({username: "test@test.com"});
accounts.save();
} catch (error) {
handleError(res, error.message);
}
and I am getting the following error:
ERROR: accounts.save is not a function
via Tom Krones
No comments:
Post a Comment