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

Missing findOrCreate and count in Query Methods #9

Closed luislobo closed 9 years ago

luislobo commented 10 years ago

There are docs for the others but findOrCreate and count are missing

https://github.com/balderdashy/waterline-docs/blob/master/query-methods.md

luislobo commented 10 years ago

Still missing...

alexbaumgertner commented 9 years ago

Confirm, I also couldn't find them :(

Here is some source code:

findOrCreate: https://github.com/balderdashy/waterline/blob/master/lib/waterline/adapter/compoundQueries.js#L11 https://github.com/balderdashy/waterline/blob/master/lib/waterline/query/composite.js#L24

count: https://github.com/balderdashy/waterline/blob/v0.10.5/lib/waterline/query/dql/count.js

Globegitter commented 9 years ago

About count you can just do Model.count().exec(function(err, count) { }); And I suppose the criteria is so you can filter the count.

dmarcelino commented 9 years ago

Thanks @Globegitter!