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 ORoperation
- $and - Performs a logical ANDoperation
- $not - Performs a logical NOToperation
- $nor - Performs a logical NORoperation
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 ORoperation
- $and - Performs a logical ANDoperation
- $not - Performs a logical NOToperation
- $nor - Performs a logical NORoperation
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.