The result iterable to base the collection on.
The max number of records to request per-query, by default.
Return an object mapping the given key value to items in this collection.
Promise
Return a new AsyncPipe of this collection.
Get the item at the given index of this collection, if one exists.
Get the average value of the collection or one of its keys.
Promise
Optional
key: KeyOperator<T, T2>Returns a clean instance of this collection pointing to the same result set of the iterable.
Promise
If this collection contains nested collections, collapse them to a single level.
Promise
Get all items in this collection as a synchronous Collection
Promise
Returns true if the collection contains an item satisfying the given collection.
collection.contains('id', '>', 4)
Promise
Optional
operand: unknownReturns the elements that are different between the two collections.
Promise
Returns the elements that are different between the two collections, using the given function as a comparator for the elements.
Promise
Returns true if every item in the collection satisfies the given where clause.
Optional
operand: unknownApplies a filter to every item in the collection and returns the results that pass the filter.
Promise
Like filter, but inverted. That is, filters out items that DO match the criterion.
Returns the first item in the collection, if one exists.
Promise
Return the first item in the collection that satisfies the given where condition, if one exists.
Promise
Optional
operator: WhereOperator = '='Optional
operand: any = trueReturn the first item in the collection that does not satisfy the given where condition, if one exists.
Optional
operator: WhereOperator = '='Optional
operand: any = trueReturn a collection containing the items that would be on the given page, with the given number of items per page.
Return an object which maps key values to arrays of items in the collection that satisfy that value.
Promise
Return the last item in this collection, if one exists.
Promise
Return the last item in this collection which satisfies the given where condition, if one exists.
Promise
Optional
operand: unknownReturn the last item in this collection which does not satisfy the given condition, if one exists.
Promise
Optional
operand: unknownApplies a callback to each item in the collection and returns the results as a collection.
Promise
Return the max value of the given key.
Promise
Get the median value of the collection or one of its keys.
Promise
Optional
key: KeyOperator<T, T2>Merge the two collections.
Promise
Return the min value of the given key.
Promise
Get the mode value of the collection or one of its keys.
Promise
Optional
key: KeyOperator<T, T2>Return a collection of every nth item in this collection.
Promise
Create a new collection by mapping the items in this collection using the given function, excluding any for which the function resolves undefined.
Build and apply a pipeline.
Return a new Pipe of this collection.
Builds a collection of the values of a given key for each item in this collection.
// collection has { a: 1 }, { a: 2 }, { a: 3 }
await collection.pluck('a') // => [1, 2, 3]
Promise
Get n random items from this collection.
add safety check for it loop exceeds max number of items
Promise
Collapse the collection into a single value using a reducer function.
Promise
Optional
initialValue: T2Returns a collection of items that fail the truth test.
Promise
Get a reversed collection of this collection's items.
Promise
Search the collection and return the index of that item, if one exists.
Promise
Get the next item in the collection and remove it.
Promise
Shuffle the items in the collection to a random order.
Promise
Return a slice of this collection.
Promise
the starting index
the ending index
Returns true if there is an item in the collection for which the given operator returns true.
Promise
Sort the collection, optionally with the given comparison function.
Promise
Optional
comparisonFunction: ComparisonFunction<T>Sort the collection by the given key.
Promise
Optional
key: KeyOperator<T, T2>Reverse sort the collection by the given key.
Promise
Optional
key: KeyOperator<T, T2>Reverse sort the collection, optionally with the given comparison function.
Promise
Optional
comparisonFunction: ComparisonFunction<T>Splice the collection at the given index. Optionally, removing the given number of items.
Promise
Optional
deleteCount: numberSum the items in the collection, or the values of the given key.
Promise
Optional
key: KeyOperator<T, T2>Take the first n items from the front or back of the collection.
Promise
Call the given function, passing in this collection. Allows functional syntax.
Promise
Return all the unique values in the collection, or the unique values of the given key.
Promise
Optional
key: KeyOperator<T, T2>Calls the passed in function if the boolean condition is false. Allows for functional syntax.
AsyncCollection
Calls the passed in function if the boolean condition is true. Allows for functional syntax.
AsyncCollection
Applies the given where condition to the collection and returns a new collection of the results.
Promise
Optional
operand: unknownApplies a WHERE ... IN ... condition to the collection an returns a new collection of the results.
Promise
Return a collection of items that have the max value of the given key.
Promise
Return a collection of items that have the min value of the given key.
Promise
Applies the given where condition to the collection and returns a new collection of the items that did not satisfy the condition.
Promise
Optional
operand: unknownApplies a WHERE ... IN ... condition to the collection and returns a new collection of the items that did not satisfy the condition.
Promise
Async collection class that iterates AbstractResultIterables in chunks.