Query
- Full name:
\Qubus\NoSql\Query
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
TYPE_GET | public | 'get' | |
TYPE_INSERT | public | 'insert' | |
TYPE_UPDATE | public | 'update' | |
TYPE_DELETE | public | 'delete' | |
TYPE_SAVE | public | 'save' |
Properties
collection
pipes
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$collection | \Qubus\NoSql\Collection |
getCollection
setCollection
Parameters:
Parameter | Type | Description |
---|---|---|
$collection | \Qubus\NoSql\Collection |
where
Where filter.
Parameters:
Parameter | Type | Description |
---|---|---|
$filter | mixed |
orWhere
Or where filter.
Parameters:
Parameter | Type | Description |
---|---|---|
$filter | mixed |
map
Parameters:
Parameter | Type | Description |
---|---|---|
$mapper | \Closure |
select
Parameters:
Parameter | Type | Description |
---|---|---|
$columns | array |
withOne
1:1 relation
public withOne(\Qubus\NoSql\Collection|\Qubus\NoSql\Query $relation, string $as, string $otherKey, string $operator = '=', string $thisKey = '_id'): \Qubus\NoSql\Query
Parameters:
Parameter | Type | Description |
---|---|---|
$relation | \Qubus\NoSql\Collection|\Qubus\NoSql\Query | |
$as | string | |
$otherKey | string | |
$operator | string | |
$thisKey | string |
Throws:
withMany
1:n relation
public withMany(\Qubus\NoSql\Collection|\Qubus\NoSql\Query $relation, string $as, string $otherKey, string $operator = '=', string $thisKey = '_id'): \Qubus\NoSql\Query
Parameters:
Parameter | Type | Description |
---|---|---|
$relation | \Qubus\NoSql\Collection|\Qubus\NoSql\Query | |
$as | string | |
$otherKey | string | |
$operator | string | |
$thisKey | string |
Throws:
sortBy
Sort results.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string|\Closure | |
$asc | string |
Throws:
skip
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | int |
take
Parameters:
Parameter | Type | Description |
---|---|---|
$limit | int | |
$offset | int |
get
Fetching a set of records in collection.
If you want to retrieve a specific column define the column in the $select
array.
Parameters:
Parameter | Type | Description |
---|---|---|
$select | array |
first
Fetch (one) record in a collection.
If you want to retrieve a specific column(s) define the column in the $select
array.
Parameters:
Parameter | Type | Description |
---|---|---|
$select | array |
update
Parameters:
Parameter | Type | Description |
---|---|---|
$new | array |
Throws:
delete
Throws:
save
Throws:
count
sum
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
avg
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
lists
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$resultKey | mixed |
pluck
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$resultKey | mixed |
min
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
max
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
getPipes
execute
Parameters:
Parameter | Type | Description |
---|---|---|
$type | string | |
$arg | array |
Throws:
addWhere
Parameters:
Parameter | Type | Description |
---|---|---|
$type | mixed | |
$filter | mixed |
Throws:
addFilter
Parameters:
Parameter | Type | Description |
---|---|---|
$filter | \Closure | |
$type | string |
addMapper
Parameters:
Parameter | Type | Description |
---|---|---|
$mapper | \Closure |
addSorter
Parameters:
Parameter | Type | Description |
---|---|---|
$value | \Closure | |
$asc | string |
getLimiter
addPipe
Parameters:
Parameter | Type | Description |
---|---|---|
$pipe | \Qubus\NoSql\Pipes\Pipe |
getLastPipe
__call
Parameters:
Parameter | Type | Description |
---|---|---|
$method | mixed | |
$args | mixed |
Throws:
Automatically generated on 2025-10-13