.fetch()
Tell Waterline (and the underlying database adapter) to send back records that were updated/destroyed/created when performing an .update()
, .create()
, .createEach()
or .destroy()
query. Otherwise, no data will be returned (or if you are using callbacks, the second argument to the .exec()
callback will be undefined
).
Warning: This is not recommended for update/destroy queries that affect large numbers of records.
.fetch()
This method doesn't accept any arguments.
var newUser = await User.create({ fullName: 'Alice McBailey' }).fetch();
sails.log(`Hi, ${newUser.fullName}! Your id is ${newUser.id}.`);
- This is just a shortcut for
.meta({fetch: true})