Query

Query library is abstraction around component model collections which provide simple functions that interact directly with data abstracted away from usual component model events.

Example usage:

query.forComponent('users')
let res = await query.find({active: true})


forComponent(ref)

Set query library to reference the component by name, tag or uuid


find(filters = {}, sort = 0, skip = 0) : any method

Find models in component


updateOne(filters = {}, data = {}) : any method

Update one model in component


updateMany(filters = {}, sort = 0, skip = 0) : any method

Update many models in component


aggregate(pipeline) : any method

Execute aggregation pipeline on component model collection


bulkWrite(operations) : any method

Execute bulk write operations on component model collection.

Currenly supported operations are updateOne, updateMany, insertOne