Query Class
Description
The query constructor.
Warehouse uses a MongoDB-like way to query documents.
Logical operators
You can use an array of two or more expressions in logical operators. For example:
query.find({ $or: [{comments: true}, {published: false}]});
- $or - Performs a logical
OR
operation - $and - Performs a logical
AND
operation - $not - Performs a logical
NOT
operation - $nor - Performs a logical
NOR
operation
Constructor
Query
(index)The query constructor.
Warehouse uses a MongoDB-like way to query documents.
Logical operators
You can use an array of two or more expressions in logical operators. For example:
query.find({ $or: [{comments: true}, {published: false}]});
- $or - Performs a logical
OR
operation - $and - Performs a logical
AND
operation - $not - Performs a logical
NOT
operation - $nor - Performs a logical
NOR
operation
Parameters
- index Array
Methods
_createQuery
(index) Query privatereduce
(callback, [initial]) AnyReduces a collection to a value which is the accumulated result of iterating each element in the collection.
Parameters
- callback Function
-
initial
Any
optional
Initial value
Returns
- Any
reduceRight
(callback, [initial]) AnyReduces a collection to a value which is the accumulated result of iterating each element in the collection from right to left.
Parameters
- callback Function
-
initial
Any
optional
Initial value
Returns
- Any
remove
([callback]) chainablereplace
(obj, [callback]) chainableupdate
(obj, [callback]) chainableProperties
_index
privateThe index of the query.
_populates
privateThe fields to populate.
length
Returns the number of items in the query.