PHP Класс LMongo\Query\Builder

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$collection string The database collection
$columns array The columns that should be returned.
$limit integer The maximum number of documents to return.
$offset integer The number of documents to skip.
$orders array The orderings for the query.
$wheres array The where constraints for the query.

Защищенные свойства (Protected)

Свойство Тип Описание
$cacheKey string The key that should be used when caching the query.
$cacheMinutes integer The number of minutes to cache the query.
$connection LMongo\Connection The database connection instance.
$first boolean Indicates if the first where set or not.

Открытые методы

Метод Описание
__construct ( Connection $connection ) : void Create a new query builder instance.
addToSet ( string $column, mixed $value = null ) : integer Append one unique value to the array key.
aggregate ( string $function, string $column, array $query = [] ) : mixed Execute an aggregate function on the database.
andWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder Add an "$and logical operation" clause to the query.
andWhereAll ( string $column, array $value ) : LMongo\Query\Builder Add an "$all comparison operation" clause to logical $and operation.
andWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder Add a where between statement to logical $and operation.
andWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder Add an "$exists element operation" clause to logical $and operation.
andWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder Add an "$geoIntersects geospatial operation" clause to logical $and operation.
andWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder Add an "$geoWithin geospatial operation" clause to logical $and operation.
andWhereGt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gt comparison operation" clause to logical $and operation.
andWhereGte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gte comparison operation" clause to logical $and operation.
andWhereIn ( string $column, array $value ) : LMongo\Query\Builder Add an "$in comparison operation" clause to logical $and operation.
andWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder Add a like statement with $regex operation to logical $and operation.
andWhereLt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lt comparison operation" clause to logical $and operation.
andWhereLte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lte comparison operation" clause to logical $and operation.
andWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder Add an "$mod element operation" clause to logical $and operation.
andWhereNe ( string $column, string $value ) : LMongo\Query\Builder Add an "$ne comparison operation" clause to logical $and operation.
andWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$near geospatial operation" clause to logical $and operation.
andWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$nearSphere geospatial operation" clause to logical $and operation.
andWhereNin ( string $column, array $value ) : LMongo\Query\Builder Add an "$nin comparison operation" clause to logical $and operation.
andWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder Add an "$regex JavaScript operation" clause to logical $and operation.
andWhereSize ( string $column, integer $value ) : LMongo\Query\Builder Add an "$size array operation" clause to logical $and operation.
andWhereType ( string $column, integer $type ) : LMongo\Query\Builder Add an "$type element operation" clause to logical $and operation.
avg ( string $column, array $query = [] ) : mixed Retrieve the avg of the values of a given column.
batchInsert ( array $data ) : mixed Insert a new documents into the database.
collection ( string $collection ) : LMongo\Query\Builder Set the collection which the query is targeting.
compileWheres ( Builder $query ) : array Compile the query
count ( ) : integer Execute the query to return count.
decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer Decrement a column's value by a given amount.
delete ( ) : integer Delete a document from the database.
distinct ( string $column, array $query = [] ) : array Execute the query to only return distinct results.
exists ( ) : boolean Determine if any document exist for the current query.
find ( integer $id, array $columns = [] ) : mixed Execute a query for a single record by _id.
first ( array $columns = [] ) : mixed Execute the query and get the first result.
forPage ( integer $page, integer $perPage = 15 ) : LMongo\Query\Builder Set the limit and offset for a given page.
generateCacheKey ( ) : string Generate the unique cache key for the query.
get ( array $columns = [] ) : LMongo\Query\Cursor Execute the query.
getAndResetWheres ( ) : array Get a copy of the where clauses and reset.
getCacheKey ( ) : string Get a unique cache key for the complete query.
getCached ( array $columns = [] ) : array Execute cached query.
getConnection ( ) : Connection Get the database connection instance.
getFresh ( array $columns = [], $cursor = false ) : array Execute fresh query.
group ( array $initial, mixed $reduce, mixed $columns = [], array $options = [] ) : LMongo\Query\Cursor Execute a group command on the database.
implode ( string $column, string $glue = null ) : string Concatenate values of a given column as a string.
increment ( string $column, integer $amount = 1, array $extra = [] ) : integer Increment a column's value by a given amount.
insert ( array $data ) : mixed Insert a new document into the database.
max ( string $column, array $query = [] ) : mixed Retrieve the maximum value of a given column.
min ( string $column, array $query = [] ) : mixed Retrieve the minimum value of a given column.
newQuery ( ) : Builder new Query Builder instance
norWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder Add an "$nor logical operation" clause to the query.
norWhereAll ( string $column, array $value ) : LMongo\Query\Builder Add an "$all comparison operation" clause to logical $nor operation.
norWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder Add a where between statement to logical $nor operation.
norWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder Add an "$exists element operation" clause to logical $nor operation.
norWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder Add an "$geoIntersects geospatial operation" clause to logical $nor operation.
norWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder Add an "$geoWithin geospatial operation" clause to logical $nor operation.
norWhereGt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gt comparison operation" clause to logical $nor operation.
norWhereGte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gte comparison operation" clause to logical $nor operation.
norWhereIn ( string $column, array $value ) : LMongo\Query\Builder Add an "$in comparison operation" clause to logical $nor operation.
norWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder Add a like statement with $regex operation to logical $nor operation.
norWhereLt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lt comparison operation" clause to logical $nor operation.
norWhereLte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lte comparison operation" clause to logical $nor operation.
norWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder Add an "$mod element operation" clause to logical $nor operation.
norWhereNe ( string $column, string $value ) : LMongo\Query\Builder Add an "$ne comparison operation" clause to logical $nor operation.
norWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$near geospatial operation" clause to logical $nor operation.
norWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$nearSphere geospatial operation" clause to logical $nor operation.
norWhereNin ( string $column, array $value ) : LMongo\Query\Builder Add an "$nin comparison operation" clause to logical $nor operation.
norWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder Add an "$regex JavaScript operation" clause to logical $nor operation.
norWhereSize ( string $column, integer $value ) : LMongo\Query\Builder Add an "$size array operation" clause to logical $nor operation.
norWhereType ( string $column, integer $type ) : LMongo\Query\Builder Add an "$type element operation" clause to logical $nor operation.
orWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder Add an "$or logical operation" clause to the query.
orWhereAll ( string $column, array $value ) : LMongo\Query\Builder Add an "$all comparison operation" clause to logical $or operation.
orWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder Add a where between statement to logical $or operation.
orWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder Add an "$exists element operation" clause to logical $or operation.
orWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder Add an "$geoIntersects geospatial operation" clause to logical $or operation.
orWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder Add an "$geoWithin geospatial operation" clause to logical $or operation.
orWhereGt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gt comparison operation" clause to logical $or operation.
orWhereGte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gte comparison operation" clause to logical $or operation.
orWhereIn ( string $column, array $value ) : LMongo\Query\Builder Add an "$in comparison operation" clause to logical $or operation.
orWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder Add a like statement with $regex operation to logical $or operation.
orWhereLt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lt comparison operation" clause to logical $or operation.
orWhereLte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lte comparison operation" clause to logical $or operation.
orWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder Add an "$mod element operation" clause to logical $or operation.
orWhereNe ( string $column, string $value ) : LMongo\Query\Builder Add an "$ne comparison operation" clause to logical $or operation.
orWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$near geospatial operation" clause to logical $or operation.
orWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder Add an "$nearSphere geospatial operation" clause to logical $or operation.
orWhereNin ( string $column, array $value ) : LMongo\Query\Builder Add an "$nin comparison operation" clause to logical $or operation.
orWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder Add an "$regex JavaScript operation" clause to logical $or operation.
orWhereSize ( string $column, integer $value ) : LMongo\Query\Builder Add an "$size array operation" clause to logical $or operation.
orWhereType ( string $column, integer $type ) : LMongo\Query\Builder Add an "$type element operation" clause to logical $or operation.
orderBy ( string $column, string $direction = 'asc' ) : LMongo\Query\Builder Add an "order by" clause to the query.
paginate ( integer $perPage = 15, array $columns = [] ) : Illuminate\Pagination\Paginator Get a paginator.
pluck ( string $column ) : mixed Pluck a single column from the database.
pop ( string $column, integer $type = 1 ) : integer Remove the last element from the array key.
pull ( string $column, mixed $value = null ) : integer Remove one value from the array key.
pullAll ( string $column, mixed $value = null ) : integer Remove several value from the array key.
push ( string $column, mixed $value = null ) : integer Append one value to the array key.
pushAll ( string $column, array $values ) : integer Append several value to the array key.
remember ( integer $minutes, string $key = null ) : Builder Indicate that the query results should be cached.
remove ( ) : integer Alias of delete.
renameField ( mixed $old, mixed $new = null ) : integer Renames a field.
resetQuery ( ) : void Reset the query
save ( array $data ) : mixed Save the document. Insert into the database if its not exists.
setConnection ( Connection $connection ) : Connection Set the database connection instance.
setField ( mixed $column, mixed $value = null ) : integer Set the values for the keys.
skip ( integer $value ) : LMongo\Query\Builder Set the "offset" value of the query.
sum ( string $column, array $query = [] ) : mixed Retrieve the sum of the values of a given column.
take ( integer $value ) : LMongo\Query\Builder Set the "limit" value of the query.
truncate ( ) : void Drop the collection.
unsetField ( mixed $column ) : integer Unset or remove the given keys.
update ( array $data ) : integer Update a document in the database.
where ( string $column, mixed $value = null, string $logic = 'first' ) : LMongo\Query\Builder Add a basic where clause to the query.
whereAll ( string $column, array $value ) : LMongo\Query\Builder Add an "$all comparison operation" clause to logical operation.
whereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder Add a where between statement to logical operation.
whereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder Add an "$exists element operation" clause to logical operation.
whereGeoIntersects ( string $column, string $geometry, array $coords, string $boolean = 'first' ) : LMongo\Query\Builder Add an "$geoIntersects geospatial operation" clause to logical operation.
whereGeoWithin ( string $column, string $shape, array $coords, string $boolean = 'first' ) : LMongo\Query\Builder Add an "$geoWithin geospatial operation" clause to logical operation.
whereGt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gt comparison operation" clause to logical operation.
whereGte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$gte comparison operation" clause to logical operation.
whereIn ( string $column, array $value ) : LMongo\Query\Builder Add an "$in comparison operation" clause to logical operation.
whereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder Add a like statement with $regex operation to logical operation.
whereLt ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lt comparison operation" clause to logical operation.
whereLte ( string $column, integer $value ) : LMongo\Query\Builder Add an "$lte comparison operation" clause to logical operation.
whereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder Add an "$mod element operation" clause to logical operation.
whereNe ( string $column, string $value ) : LMongo\Query\Builder Add an "$ne comparison operation" clause to logical operation.
whereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null, string $boolean = 'first' ) : LMongo\Query\Builder Add an "$near geospatial operation" clause to logical operation.
whereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null, string $boolean = 'first' ) : LMongo\Query\Builder Add an "$nearSphere geospatial operation" clause to logical operation.
whereNested ( Closure $callback, string $logic = '$and' ) : LMongo\Query\Builder Add a nested where statement to the query.
whereNin ( string $column, array $value ) : LMongo\Query\Builder Add an "$nin comparison operation" clause to logical operation.
whereRegex ( string $column, mixed $value ) : LMongo\Query\Builder Add an "$regex JavaScript operation" clause to logical operation.
whereSize ( string $column, integer $value ) : LMongo\Query\Builder Add an "$size array operation" clause to logical operation.
whereType ( string $column, integer $type ) : LMongo\Query\Builder Add an "$type element operation" clause to logical operation.

Защищенные методы

Метод Описание
compileWhereBasic ( Builder $query, array $where ) : array Compile a basic operation clause.
compileWhereNested ( Builder $query, array $where ) : array Compile a nested operation clause.
getCacheCallback ( array $columns ) : Closure Get the Closure callback used when caching queries.
getCacheInfo ( ) : array Get the cache key and cache minutes as an array.
performUpdate ( array $query ) : integer Perform update.

Приватные методы

Метод Описание
prepareColumns ( ) : array Retrieve the select statement.
prepareOrderBy ( mixed $direction ) : integer Transform sql style order statement to mongodb style.

Описание методов

__construct() публичный метод

Create a new query builder instance.
public __construct ( Connection $connection ) : void
$connection LMongo\Connection
Результат void

addToSet() публичный метод

Append one unique value to the array key.
public addToSet ( string $column, mixed $value = null ) : integer
$column string
$value mixed
Результат integer

aggregate() публичный метод

Execute an aggregate function on the database.
public aggregate ( string $function, string $column, array $query = [] ) : mixed
$function string
$column string
$query array
Результат mixed

andWhere() публичный метод

Add an "$and logical operation" clause to the query.
public andWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

andWhereAll() публичный метод

Add an "$all comparison operation" clause to logical $and operation.
public andWhereAll ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

andWhereBetween() публичный метод

Add a where between statement to logical $and operation.
public andWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder
$column string
$min integer
$max integer
Результат LMongo\Query\Builder

andWhereExists() публичный метод

Add an "$exists element operation" clause to logical $and operation.
public andWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder
$column string
$exists boolean
Результат LMongo\Query\Builder

andWhereGeoIntersects() публичный метод

Add an "$geoIntersects geospatial operation" clause to logical $and operation.
public andWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder
$column string
$geometry string
$coords array
Результат LMongo\Query\Builder

andWhereGeoWithin() публичный метод

Add an "$geoWithin geospatial operation" clause to logical $and operation.
public andWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder
$column string
$shape string
$coords array
Результат LMongo\Query\Builder

andWhereGt() публичный метод

Add an "$gt comparison operation" clause to logical $and operation.
public andWhereGt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

andWhereGte() публичный метод

Add an "$gte comparison operation" clause to logical $and operation.
public andWhereGte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

andWhereIn() публичный метод

Add an "$in comparison operation" clause to logical $and operation.
public andWhereIn ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

andWhereLike() публичный метод

Add a like statement with $regex operation to logical $and operation.
public andWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder
$column string
$value mixed
$flags string
Результат LMongo\Query\Builder

andWhereLt() публичный метод

Add an "$lt comparison operation" clause to logical $and operation.
public andWhereLt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

andWhereLte() публичный метод

Add an "$lte comparison operation" clause to logical $and operation.
public andWhereLte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

andWhereMod() публичный метод

Add an "$mod element operation" clause to logical $and operation.
public andWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder
$column string
$divisor integer
$remainder integer
Результат LMongo\Query\Builder

andWhereNe() публичный метод

Add an "$ne comparison operation" clause to logical $and operation.
public andWhereNe ( string $column, string $value ) : LMongo\Query\Builder
$column string
$value string
Результат LMongo\Query\Builder

andWhereNear() публичный метод

Add an "$near geospatial operation" clause to logical $and operation.
public andWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

andWhereNearSphere() публичный метод

Add an "$nearSphere geospatial operation" clause to logical $and operation.
public andWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

andWhereNin() публичный метод

Add an "$nin comparison operation" clause to logical $and operation.
public andWhereNin ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

andWhereRegex() публичный метод

Add an "$regex JavaScript operation" clause to logical $and operation.
public andWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

andWhereSize() публичный метод

Add an "$size array operation" clause to logical $and operation.
public andWhereSize ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

andWhereType() публичный метод

Add an "$type element operation" clause to logical $and operation.
public andWhereType ( string $column, integer $type ) : LMongo\Query\Builder
$column string
$type integer
Результат LMongo\Query\Builder

avg() публичный метод

Retrieve the avg of the values of a given column.
public avg ( string $column, array $query = [] ) : mixed
$column string
$query array
Результат mixed

batchInsert() публичный метод

Insert a new documents into the database.
public batchInsert ( array $data ) : mixed
$data array
Результат mixed

collection() публичный метод

Set the collection which the query is targeting.
public collection ( string $collection ) : LMongo\Query\Builder
$collection string
Результат LMongo\Query\Builder

compileWhereBasic() защищенный метод

Compile a basic operation clause.
protected compileWhereBasic ( Builder $query, array $where ) : array
$query Builder
$where array
Результат array

compileWhereNested() защищенный метод

Compile a nested operation clause.
protected compileWhereNested ( Builder $query, array $where ) : array
$query Builder
$where array
Результат array

compileWheres() публичный метод

Compile the query
public compileWheres ( Builder $query ) : array
$query Builder
Результат array

count() публичный метод

Execute the query to return count.
public count ( ) : integer
Результат integer

decrement() публичный метод

Decrement a column's value by a given amount.
public decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

delete() публичный метод

Delete a document from the database.
public delete ( ) : integer
Результат integer

distinct() публичный метод

Execute the query to only return distinct results.
public distinct ( string $column, array $query = [] ) : array
$column string
$query array
Результат array

exists() публичный метод

Determine if any document exist for the current query.
public exists ( ) : boolean
Результат boolean

find() публичный метод

Execute a query for a single record by _id.
public find ( integer $id, array $columns = [] ) : mixed
$id integer
$columns array
Результат mixed

first() публичный метод

Execute the query and get the first result.
public first ( array $columns = [] ) : mixed
$columns array
Результат mixed

forPage() публичный метод

Set the limit and offset for a given page.
public forPage ( integer $page, integer $perPage = 15 ) : LMongo\Query\Builder
$page integer
$perPage integer
Результат LMongo\Query\Builder

generateCacheKey() публичный метод

Generate the unique cache key for the query.
public generateCacheKey ( ) : string
Результат string

get() публичный метод

Execute the query.
public get ( array $columns = [] ) : LMongo\Query\Cursor
$columns array
Результат LMongo\Query\Cursor

getAndResetWheres() публичный метод

Get a copy of the where clauses and reset.
public getAndResetWheres ( ) : array
Результат array

getCacheCallback() защищенный метод

Get the Closure callback used when caching queries.
protected getCacheCallback ( array $columns ) : Closure
$columns array
Результат Closure

getCacheInfo() защищенный метод

Get the cache key and cache minutes as an array.
protected getCacheInfo ( ) : array
Результат array

getCacheKey() публичный метод

Get a unique cache key for the complete query.
public getCacheKey ( ) : string
Результат string

getCached() публичный метод

Execute cached query.
public getCached ( array $columns = [] ) : array
$columns array
Результат array

getConnection() публичный метод

Get the database connection instance.
public getConnection ( ) : Connection
Результат LMongo\Connection

getFresh() публичный метод

Execute fresh query.
public getFresh ( array $columns = [], $cursor = false ) : array
$columns array
Результат array

group() публичный метод

Execute a group command on the database.
public group ( array $initial, mixed $reduce, mixed $columns = [], array $options = [] ) : LMongo\Query\Cursor
$initial array
$reduce mixed
$columns mixed
$options array
Результат LMongo\Query\Cursor

implode() публичный метод

Concatenate values of a given column as a string.
public implode ( string $column, string $glue = null ) : string
$column string
$glue string
Результат string

increment() публичный метод

Increment a column's value by a given amount.
public increment ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

insert() публичный метод

Insert a new document into the database.
public insert ( array $data ) : mixed
$data array
Результат mixed

max() публичный метод

Retrieve the maximum value of a given column.
public max ( string $column, array $query = [] ) : mixed
$column string
$query array
Результат mixed

min() публичный метод

Retrieve the minimum value of a given column.
public min ( string $column, array $query = [] ) : mixed
$column string
$query array
Результат mixed

newQuery() публичный метод

new Query Builder instance
public newQuery ( ) : Builder
Результат Builder

norWhere() публичный метод

Add an "$nor logical operation" clause to the query.
public norWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

norWhereAll() публичный метод

Add an "$all comparison operation" clause to logical $nor operation.
public norWhereAll ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

norWhereBetween() публичный метод

Add a where between statement to logical $nor operation.
public norWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder
$column string
$min integer
$max integer
Результат LMongo\Query\Builder

norWhereExists() публичный метод

Add an "$exists element operation" clause to logical $nor operation.
public norWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder
$column string
$exists boolean
Результат LMongo\Query\Builder

norWhereGeoIntersects() публичный метод

Add an "$geoIntersects geospatial operation" clause to logical $nor operation.
public norWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder
$column string
$geometry string
$coords array
Результат LMongo\Query\Builder

norWhereGeoWithin() публичный метод

Add an "$geoWithin geospatial operation" clause to logical $nor operation.
public norWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder
$column string
$shape string
$coords array
Результат LMongo\Query\Builder

norWhereGt() публичный метод

Add an "$gt comparison operation" clause to logical $nor operation.
public norWhereGt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

norWhereGte() публичный метод

Add an "$gte comparison operation" clause to logical $nor operation.
public norWhereGte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

norWhereIn() публичный метод

Add an "$in comparison operation" clause to logical $nor operation.
public norWhereIn ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

norWhereLike() публичный метод

Add a like statement with $regex operation to logical $nor operation.
public norWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder
$column string
$value mixed
$flags string
Результат LMongo\Query\Builder

norWhereLt() публичный метод

Add an "$lt comparison operation" clause to logical $nor operation.
public norWhereLt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

norWhereLte() публичный метод

Add an "$lte comparison operation" clause to logical $nor operation.
public norWhereLte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

norWhereMod() публичный метод

Add an "$mod element operation" clause to logical $nor operation.
public norWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder
$column string
$divisor integer
$remainder integer
Результат LMongo\Query\Builder

norWhereNe() публичный метод

Add an "$ne comparison operation" clause to logical $nor operation.
public norWhereNe ( string $column, string $value ) : LMongo\Query\Builder
$column string
$value string
Результат LMongo\Query\Builder

norWhereNear() публичный метод

Add an "$near geospatial operation" clause to logical $nor operation.
public norWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

norWhereNearSphere() публичный метод

Add an "$nearSphere geospatial operation" clause to logical $nor operation.
public norWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

norWhereNin() публичный метод

Add an "$nin comparison operation" clause to logical $nor operation.
public norWhereNin ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

norWhereRegex() публичный метод

Add an "$regex JavaScript operation" clause to logical $nor operation.
public norWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

norWhereSize() публичный метод

Add an "$size array operation" clause to logical $nor operation.
public norWhereSize ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

norWhereType() публичный метод

Add an "$type element operation" clause to logical $nor operation.
public norWhereType ( string $column, integer $type ) : LMongo\Query\Builder
$column string
$type integer
Результат LMongo\Query\Builder

orWhere() публичный метод

Add an "$or logical operation" clause to the query.
public orWhere ( string $column, mixed $value = null ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

orWhereAll() публичный метод

Add an "$all comparison operation" clause to logical $or operation.
public orWhereAll ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

orWhereBetween() публичный метод

Add a where between statement to logical $or operation.
public orWhereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder
$column string
$min integer
$max integer
Результат LMongo\Query\Builder

orWhereExists() публичный метод

Add an "$exists element operation" clause to logical $or operation.
public orWhereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder
$column string
$exists boolean
Результат LMongo\Query\Builder

orWhereGeoIntersects() публичный метод

Add an "$geoIntersects geospatial operation" clause to logical $or operation.
public orWhereGeoIntersects ( string $column, string $geometry, array $coords ) : LMongo\Query\Builder
$column string
$geometry string
$coords array
Результат LMongo\Query\Builder

orWhereGeoWithin() публичный метод

Add an "$geoWithin geospatial operation" clause to logical $or operation.
public orWhereGeoWithin ( string $column, string $shape, array $coords ) : LMongo\Query\Builder
$column string
$shape string
$coords array
Результат LMongo\Query\Builder

orWhereGt() публичный метод

Add an "$gt comparison operation" clause to logical $or operation.
public orWhereGt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

orWhereGte() публичный метод

Add an "$gte comparison operation" clause to logical $or operation.
public orWhereGte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

orWhereIn() публичный метод

Add an "$in comparison operation" clause to logical $or operation.
public orWhereIn ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

orWhereLike() публичный метод

Add a like statement with $regex operation to logical $or operation.
public orWhereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder
$column string
$value mixed
$flags string
Результат LMongo\Query\Builder

orWhereLt() публичный метод

Add an "$lt comparison operation" clause to logical $or operation.
public orWhereLt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

orWhereLte() публичный метод

Add an "$lte comparison operation" clause to logical $or operation.
public orWhereLte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

orWhereMod() публичный метод

Add an "$mod element operation" clause to logical $or operation.
public orWhereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder
$column string
$divisor integer
$remainder integer
Результат LMongo\Query\Builder

orWhereNe() публичный метод

Add an "$ne comparison operation" clause to logical $or operation.
public orWhereNe ( string $column, string $value ) : LMongo\Query\Builder
$column string
$value string
Результат LMongo\Query\Builder

orWhereNear() публичный метод

Add an "$near geospatial operation" clause to logical $or operation.
public orWhereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

orWhereNearSphere() публичный метод

Add an "$nearSphere geospatial operation" clause to logical $or operation.
public orWhereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
Результат LMongo\Query\Builder

orWhereNin() публичный метод

Add an "$nin comparison operation" clause to logical $or operation.
public orWhereNin ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

orWhereRegex() публичный метод

Add an "$regex JavaScript operation" clause to logical $or operation.
public orWhereRegex ( string $column, mixed $value ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

orWhereSize() публичный метод

Add an "$size array operation" clause to logical $or operation.
public orWhereSize ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

orWhereType() публичный метод

Add an "$type element operation" clause to logical $or operation.
public orWhereType ( string $column, integer $type ) : LMongo\Query\Builder
$column string
$type integer
Результат LMongo\Query\Builder

orderBy() публичный метод

Add an "order by" clause to the query.
public orderBy ( string $column, string $direction = 'asc' ) : LMongo\Query\Builder
$column string
$direction string
Результат LMongo\Query\Builder

paginate() публичный метод

Get a paginator.
public paginate ( integer $perPage = 15, array $columns = [] ) : Illuminate\Pagination\Paginator
$perPage integer
$columns array
Результат Illuminate\Pagination\Paginator

performUpdate() защищенный метод

Perform update.
protected performUpdate ( array $query ) : integer
$query array
Результат integer

pluck() публичный метод

Pluck a single column from the database.
public pluck ( string $column ) : mixed
$column string
Результат mixed

pop() публичный метод

Remove the last element from the array key.
public pop ( string $column, integer $type = 1 ) : integer
$column string
$type integer
Результат integer

pull() публичный метод

Remove one value from the array key.
public pull ( string $column, mixed $value = null ) : integer
$column string
$value mixed
Результат integer

pullAll() публичный метод

Remove several value from the array key.
public pullAll ( string $column, mixed $value = null ) : integer
$column string
$value mixed
Результат integer

push() публичный метод

Append one value to the array key.
public push ( string $column, mixed $value = null ) : integer
$column string
$value mixed
Результат integer

pushAll() публичный метод

Append several value to the array key.
public pushAll ( string $column, array $values ) : integer
$column string
$values array
Результат integer

remember() публичный метод

Indicate that the query results should be cached.
public remember ( integer $minutes, string $key = null ) : Builder
$minutes integer
$key string
Результат Builder

remove() публичный метод

Alias of delete.
public remove ( ) : integer
Результат integer

renameField() публичный метод

Renames a field.
public renameField ( mixed $old, mixed $new = null ) : integer
$old mixed
$new mixed
Результат integer

resetQuery() публичный метод

Reset the query
public resetQuery ( ) : void
Результат void

save() публичный метод

Save the document. Insert into the database if its not exists.
public save ( array $data ) : mixed
$data array
Результат mixed

setConnection() публичный метод

Set the database connection instance.
public setConnection ( Connection $connection ) : Connection
$connection LMongo\Connection
Результат LMongo\Connection

setField() публичный метод

Set the values for the keys.
public setField ( mixed $column, mixed $value = null ) : integer
$column mixed
$value mixed
Результат integer

skip() публичный метод

Set the "offset" value of the query.
public skip ( integer $value ) : LMongo\Query\Builder
$value integer
Результат LMongo\Query\Builder

sum() публичный метод

Retrieve the sum of the values of a given column.
public sum ( string $column, array $query = [] ) : mixed
$column string
$query array
Результат mixed

take() публичный метод

Set the "limit" value of the query.
public take ( integer $value ) : LMongo\Query\Builder
$value integer
Результат LMongo\Query\Builder

truncate() публичный метод

Drop the collection.
public truncate ( ) : void
Результат void

unsetField() публичный метод

Unset or remove the given keys.
public unsetField ( mixed $column ) : integer
$column mixed
Результат integer

update() публичный метод

Update a document in the database.
public update ( array $data ) : integer
$data array
Результат integer

where() публичный метод

Add a basic where clause to the query.
public where ( string $column, mixed $value = null, string $logic = 'first' ) : LMongo\Query\Builder
$column string
$value mixed
$logic string
Результат LMongo\Query\Builder

whereAll() публичный метод

Add an "$all comparison operation" clause to logical operation.
public whereAll ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

whereBetween() публичный метод

Add a where between statement to logical operation.
public whereBetween ( string $column, integer $min, integer $max ) : LMongo\Query\Builder
$column string
$min integer
$max integer
Результат LMongo\Query\Builder

whereExists() публичный метод

Add an "$exists element operation" clause to logical operation.
public whereExists ( string $column, boolean $exists = true ) : LMongo\Query\Builder
$column string
$exists boolean
Результат LMongo\Query\Builder

whereGeoIntersects() публичный метод

Add an "$geoIntersects geospatial operation" clause to logical operation.
public whereGeoIntersects ( string $column, string $geometry, array $coords, string $boolean = 'first' ) : LMongo\Query\Builder
$column string
$geometry string
$coords array
$boolean string
Результат LMongo\Query\Builder

whereGeoWithin() публичный метод

Add an "$geoWithin geospatial operation" clause to logical operation.
public whereGeoWithin ( string $column, string $shape, array $coords, string $boolean = 'first' ) : LMongo\Query\Builder
$column string
$shape string
$coords array
$boolean string
Результат LMongo\Query\Builder

whereGt() публичный метод

Add an "$gt comparison operation" clause to logical operation.
public whereGt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

whereGte() публичный метод

Add an "$gte comparison operation" clause to logical operation.
public whereGte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

whereIn() публичный метод

Add an "$in comparison operation" clause to logical operation.
public whereIn ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

whereLike() публичный метод

Add a like statement with $regex operation to logical operation.
public whereLike ( string $column, mixed $value, string $flags = 'im' ) : LMongo\Query\Builder
$column string
$value mixed
$flags string
Результат LMongo\Query\Builder

whereLt() публичный метод

Add an "$lt comparison operation" clause to logical operation.
public whereLt ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

whereLte() публичный метод

Add an "$lte comparison operation" clause to logical operation.
public whereLte ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

whereMod() публичный метод

Add an "$mod element operation" clause to logical operation.
public whereMod ( string $column, integer $divisor, integer $remainder ) : LMongo\Query\Builder
$column string
$divisor integer
$remainder integer
Результат LMongo\Query\Builder

whereNe() публичный метод

Add an "$ne comparison operation" clause to logical operation.
public whereNe ( string $column, string $value ) : LMongo\Query\Builder
$column string
$value string
Результат LMongo\Query\Builder

whereNear() публичный метод

Add an "$near geospatial operation" clause to logical operation.
public whereNear ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null, string $boolean = 'first' ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
$boolean string
Результат LMongo\Query\Builder

whereNearSphere() публичный метод

Add an "$nearSphere geospatial operation" clause to logical operation.
public whereNearSphere ( string $column, array $coords, mixed $geometry = null, mixed $maxDistance = null, string $boolean = 'first' ) : LMongo\Query\Builder
$column string
$coords array
$geometry mixed
$maxDistance mixed
$boolean string
Результат LMongo\Query\Builder

whereNested() публичный метод

Add a nested where statement to the query.
public whereNested ( Closure $callback, string $logic = '$and' ) : LMongo\Query\Builder
$callback Closure
$logic string
Результат LMongo\Query\Builder

whereNin() публичный метод

Add an "$nin comparison operation" clause to logical operation.
public whereNin ( string $column, array $value ) : LMongo\Query\Builder
$column string
$value array
Результат LMongo\Query\Builder

whereRegex() публичный метод

Add an "$regex JavaScript operation" clause to logical operation.
public whereRegex ( string $column, mixed $value ) : LMongo\Query\Builder
$column string
$value mixed
Результат LMongo\Query\Builder

whereSize() публичный метод

Add an "$size array operation" clause to logical operation.
public whereSize ( string $column, integer $value ) : LMongo\Query\Builder
$column string
$value integer
Результат LMongo\Query\Builder

whereType() публичный метод

Add an "$type element operation" clause to logical operation.
public whereType ( string $column, integer $type ) : LMongo\Query\Builder
$column string
$type integer
Результат LMongo\Query\Builder

Описание свойств

$cacheKey защищенное свойство

The key that should be used when caching the query.
protected string $cacheKey
Результат string

$cacheMinutes защищенное свойство

The number of minutes to cache the query.
protected int $cacheMinutes
Результат integer

$collection публичное свойство

The database collection
public string $collection
Результат string

$columns публичное свойство

The columns that should be returned.
public array $columns
Результат array

$connection защищенное свойство

The database connection instance.
protected LMongo\Connection $connection
Результат LMongo\Connection

$first защищенное свойство

Indicates if the first where set or not.
protected bool $first
Результат boolean

$limit публичное свойство

The maximum number of documents to return.
public int $limit
Результат integer

$offset публичное свойство

The number of documents to skip.
public int $offset
Результат integer

$orders публичное свойство

The orderings for the query.
public array $orders
Результат array

$wheres публичное свойство

The where constraints for the query.
public array $wheres
Результат array