- references to the plain JS objects represented by
the QuerySet
toModelArray()⇒ Array.<Model>
Returns an array of [Model](Model) instances represented by the QuerySet.
Kind : instance method of QuerySet
Returns : Array. -
model instances represented by the QuerySet
count()⇒ number
Returns the number of [Model](Model) instances represented by the QuerySet.
Kind : instance method of QuerySet
Returns : number -
length of the QuerySet
exists()⇒ Boolean
Checks if the [QuerySet](#QuerySet) instance has any records matching the query
in the database.
Kind : instance method of QuerySet
Returns : Boolean -
true if the QuerySet instance contains entities, else false.
at(index)⇒ Model,undefined
Returns the [Model](Model) instance at index index in the [QuerySet](#QuerySet) instance if
withRefs flag is set to false, or a reference to the plain JavaScript
object in the model state if true.
Kind : instance method of QuerySet
Returns : Model ⎮ undefined -
a Model instance at index
index in the QuerySet instance,
or undefined if the index is out of bounds.
Param Type Description
index number index of the model instance to get
first()⇒ Model
Returns the [Model](Model) instance at index 0 in the [QuerySet](#QuerySet) instance.
Kind : instance method of QuerySet
last()⇒ Model
Returns the [Model](Model) instance at index QuerySet.count() - 1
Kind : instance method of QuerySet
all()⇒ QuerySet
Returns a new [QuerySet](#QuerySet) instance with the same entities.
Kind : instance method of QuerySet
Returns : QuerySet -
a new QuerySet with the same entities.
filter(lookupObj)⇒ QuerySet
Returns a new [QuerySet](#QuerySet) instance with entities that match properties in lookupObj.
Kind : instance method of QuerySet
Returns : QuerySet -
a new QuerySet instance with objects that passed the filter.
Param Type Description
lookupObj Object the properties to match objects with. Can also be a function. It works the same as Lodash filter .
exclude(lookupObj)⇒ QuerySet
Returns a new [QuerySet](#QuerySet) instance with entities that do not match
properties in lookupObj.
Kind : instance method of QuerySet
Returns : QuerySet -
a new QuerySet instance with objects that did not pass the filter.
Param Type Description
lookupObj Object the properties to unmatch objects with. Can also be a function. It works the same as Lodash reject .
orderBy(iteratees, [orders])⇒ QuerySet
Returns a new [QuerySet](#QuerySet) instance with entities ordered by iteratees in ascending
order, unless otherwise specified. Delegates to Lodash orderBy .
Kind : instance method of QuerySet
Returns : QuerySet -
a new QuerySet with objects ordered by iteratees.
Param Type Description
iteratees Array. ⎮ Array.<function()> an array where each item can be a string or a function. If a string is supplied, it should correspond to property on the entity that will determine the order. If a function is supplied, it should return the value to order by.
[orders] Array.<(Boolean 'asc' 'desc')> the sort orders of iteratees. If unspecified, all iteratees will be sorted in ascending order. true and 'asc' correspond to ascending order, and false and 'desc' to descending order.
update(mergeObj)⇒ undefined
Records an update specified with mergeObj to all the objects
in the [QuerySet](#QuerySet) instance.
Kind : instance method of QuerySet
Param Type Description
mergeObj Object an object to merge with all the objects in this queryset.
delete()⇒ undefined
Records a deletion of all the objects in this [QuerySet](#QuerySet) instance.
Kind : instance method of QuerySet
map()
Deprecated
Kind : instance method of QuerySet
forEach()
Deprecated
Kind : instance method of QuerySet
Last updated on 10.1.2020