You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model has query, save, fetch, destroy methods and Sync has similar methods (first, select, insert, update, del) as well. What's the difference between two or they can be used interchangeably?
To query I could use Model.query().where() or I can use sync.select([options])
The text was updated successfully, but these errors were encountered:
@amitava82 you actually don't want to use sync directly, it is really only documented for explanation purposes (in-case you want to extend) and primarily used internally. What you'll want to do is use save, fetch and destroy on the models/collections... if you need to use the query method, it's often to tap into the query chain for the current object.
// resolves with a Bookshelf modelmodel.query('where','id','>',30).fetch().then(...
// resolves with a response array, might as well be using Knex at this pointmodel.query().where('id','>',30).select().then(...
Model has query, save, fetch, destroy methods and Sync has similar methods (first, select, insert, update, del) as well. What's the difference between two or they can be used interchangeably?
To query I could use
Model.query().where()
or I can usesync.select([options])
The text was updated successfully, but these errors were encountered: