Skip to content

Instantly share code, notes, and snippets.

@srushti
Last active August 29, 2015 14:10
Show Gist options
  • Save srushti/332f1183142a5e95b5d9 to your computer and use it in GitHub Desktop.
Save srushti/332f1183142a5e95b5d9 to your computer and use it in GitHub Desktop.
fetchAll

Code:

    new Account({
      accountNumber: 123123
    }).fetchAll({
      withRelated: 'customer'
    }).then(function(accounts) {
      // accounts has all the elements
    });

Logging:

{ __cid: '__cid1',
  method: 'select',
  options: undefined,
  bindings: [],
  sql: 'select "accounts".* from "accounts"' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment