Select Query
When you query model via ObjectManager, you'll get a Select object.
Select instance methods#
all#
Promise to return all model instances
count#
Promise to count all model instances
distinct#
Select only distinct records.
exclude#
Exclude records matching filter. This is an inversion of .filter
filter#
Include only records matching filter. This an inversion of .exclude.
first#
Promise to return first model instance. This is an inversion of .last
get#
Filter model instances and get the first one or throw ObjectDoesNotExist
last#
Promise to return the last model instance. This is an inversion of .first.
limit#
Select only certain amount of records.
selectRelated#
Joins selected ForeignKey fields and automatically maps the model instances.
stream#
Stream read model instances with Node.js streams. Returns instance of Readable.