balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 161 forks source link

how to sepcify the return fields #82

Closed kuangyunsheng closed 9 years ago

kuangyunsheng commented 9 years ago

I want return only the name field by applying a projection to a waterline query:

Model.find({ where: { age: { '<': 30 } }, select: ['name'] })

but it still return all of the fields。

dmarcelino commented 9 years ago

Hi @kuangyunsheng, this github project is only for documentation related issues so this is not the right place to discuss this.

Which adapter are you using? Sails-mongo did not support select until recently (balderdashy/sails-mongo#281), a fix has been made and it will go out in the next release (v0.11.3 I believe).