Skip to content

Conversation

jvskelton
Copy link
Contributor

See #90.

Modified .all method to accept attributes property to select single or multiple columns.

Example 1:

model.all({where : {name: 'bill'}, attributes: 'id'}}, callback)
OR
model.all({attributes: 'id'}}, callback)

returns array of ids (e.g. [ 1, 2 ]):

Example 2 :

model.all({where : {name: 'bill'}, attributes: ['id']}}, callback)
OR
model.all({attributes: ['id']}}, callback)

returns array of objects(e.g. [{id: 1}, {id: 2}]):

Example 3:

model.all({where: {address: '123'}, attributes: ['id', 'name']},callback)
OR
model.all({, attributes: ['id', 'name']},callback)

returns [{id: 1, name: 'bill'}, {id: 2. name: 'alice'}]:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be replaced with .all

@1602
Copy link
Contributor

1602 commented Jul 3, 2014

This was merged to branch latest. Please not that tests are still failing. Can you please fix?

@1602
Copy link
Contributor

1602 commented Jul 3, 2014

no problems, i will review anyway if you push

On 3 July 2014 15:18, jvskelton [email protected] wrote:

@anatoliychakkaev https://github.com/anatoliychakkaev just a heads up:
with the recent changes to jugglingdb core, this will also require some
modifications to adapter.all, specifically, the functionality that returns
an array of data vs array of objects (depending on the attribute
type(string vs array)


Reply to this email directly or view it on GitHub
#91 (comment)
.

Thanks,
Anatoliy Chakkaev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants