new ReadOptionsProcessor()
The processor for read actions.
Methods
fields(fields)
Set the fields
Parameters:
Name | Type | Description |
---|---|---|
fields |
object | array | The restricted fields |
Examples
x.fields(['firstName', 'lastName'])
x.fields({
firstName: 1,
lastName: 1
})
options(options)
Set the options
Parameters:
Name | Type | Description |
---|---|---|
options |
object | The options |
Example
x.options({
start: 0,
limit: 50,
sort: { firstName: 1 }
}})
query(query)
Set the query
Parameters:
Name | Type | Description |
---|---|---|
query |
object | The query object |
Example
x.query({
firstName: 'John',
lastName: 'Smith'
})