Public Member Functions | |
array string | insert (array|string $record) |
Inserts an array into the collection. | |
array string | update (array|string $rule, array|string $condition=NULL, array|string $hint=NULL) |
Update the matching documents in current collection. | |
array string | remove (array|string $condition=NULL, array|string $hint=NULL) |
Remove records from this collection. | |
SequoiaCursor | find (array|string $condition=NULL, array|string $select=NULL, array|string $orderBy=NULL, array|string $hint=NULL, int $numToSkip=0, int $numToReturn=-1) |
Querys this collection, returning a SequoiaCursor for the result set. | |
SequoiaCursor | findAndUpdate (array|string $update, array|string $condition=NULL, array|string $select=NULL, array|string $orderBy=NULL, array|string $hint=NULL, int $numToSkip=0, int $numToReturn=-1, bool $returnNew=FALSE) |
Querys this collection, returning a SequoiaCursor for the result set and update. | |
SequoiaCursor | findAndRemove (array|string $condition=NULL, array|string $select=NULL, array|string $orderBy=NULL, array|string $hint=NULL, int $numToSkip=0, int $numToReturn=-1) |
Querys this collection, returning a SequoiaCursor for the result set and remove. | |
array string | split (string $sourceName, string $destName, array|string $condition, array|string $endCondition=NULL) |
data split,source collection split to dest collection | |
array string | split (string $sourceName, string $destName, double $percent) |
data split,source collection split to dest collection | |
array string | drop (void) |
Drops this collection. | |
SequoiaCursor | aggregate (array|string $aggrObj) |
aggregate this collection, returning a SequoiaCursor for the result set | |
array string | createIndex (array|string $indexDef, string $pIndexName, bool $isUnique=false, bool $isEnforced=false, int $sortBufferSize=64) |
Create the index in current collection. | |
array string | deleteIndex (string $pIndexName) |
delete the index in current collection | |
SequoiaCursor | getIndex (string $pIndexName="") |
Get all of or one of the indexes in current collection. | |
string | getCSName (void) |
Returns this collection space's name. | |
string | getCollectionName (void) |
Returns this collection's name. | |
string | getFullName (void) |
Returns this collection full name. | |
int | count (array|string $condition=NULL) |
Counts the number of documents in this collection. | |
int | truncate (void) |
Removes all rows from a collection without logging the individual row deletions. | |
int | createIdIndex (void) |
create records "_id" index. | |
int | dropIdIndex (void) |
drop records "_id" index. | |
SequoiaCursor SequoiaCL::aggregate | ( | array|string | $aggrObj | ) |
aggregate this collection, returning a SequoiaCursor for the result set
[in] | $aggrObj | Aggregation parameter, if the input string or an associative array, you can enter only one parameter, such as the string, "{ $project: {field:1}}", an associative array, array( '$project' => array ( 'field' => 1 ) ), if the input array, you can enter multiple parameters, such as array ( "{$project:{field1:1,field2:2}}", "{$project:{field1:1}}" ) or array ( array ( '$project' => array ( 'field1' => 1, "field2' => 2 ) ), array ( '$project' => array ( 'field1' => 1 ) ) ) |
Returns | a SequoiaCursor for the result set |
int SequoiaCL::count | ( | array|string | $condition = NULL | ) |
Counts the number of documents in this collection.
[in] | $condition | The matching rule, return the count of all documents if this parameter is null |
Returns | the number of documents matching the query |
int SequoiaCL::createIdIndex | ( | void | ) |
create records "_id" index.
Returns | the database response |
array string SequoiaCL::createIndex | ( | array|string | $indexDef, |
string | $pIndexName, | ||
bool | $isUnique = false , |
||
bool | $isEnforced = false , |
||
int | $sortBufferSize = 64 |
||
) |
Create the index in current collection.
[in] | $indexDef | The bson structure of index element, e.g. {name:1, age:-1} |
[in] | $pIndexName | The index name |
[in] | $isUnique | Whether the index elements are unique or not,default is FALSE |
[in] | $isEnforced | Whether the index is enforced unique This element is meaningful when isUnique is set to true |
[in] | $sortBufferSize | The size of sort buffer used when creating index, the unit is MB, zero means don't use sort buffer |
Returns | the database response |
array string SequoiaCL::deleteIndex | ( | string | $pIndexName | ) |
delete the index in current collection
[in] | $pIndexName | The index name |
Returns | the database response |
array string SequoiaCL::drop | ( | void | ) |
Drops this collection.
Returns | the database response |
int SequoiaCL::dropIdIndex | ( | void | ) |
drop records "_id" index.
Returns | the database response |
SequoiaCursor SequoiaCL::find | ( | array|string | $condition = NULL , |
array|string | $select = NULL , |
||
array|string | $orderBy = NULL , |
||
array|string | $hint = NULL , |
||
int | $numToSkip = 0 , |
||
int | $numToReturn = -1 |
||
) |
Querys this collection, returning a SequoiaCursor for the result set.
[in] | $condition | The matching rule, return all the documents if null |
[in] | $select | The selective rule, return the whole document if null |
[in] | $orderBy | The ordered rule, never sort if null |
[in] | $hint | The hint, automatically match the optimal hint if null |
[in] | $numToSkip | Skip the first numToSkip documents, never skip if this parameter is 0 |
[in] | $numToReturn | Only return numToReturn documents, return all if this parameter is -1 |
Returns | a SequoiaCursor for the result set |
SequoiaCursor SequoiaCL::findAndRemove | ( | array|string | $condition = NULL , |
array|string | $select = NULL , |
||
array|string | $orderBy = NULL , |
||
array|string | $hint = NULL , |
||
int | $numToSkip = 0 , |
||
int | $numToReturn = -1 |
||
) |
Querys this collection, returning a SequoiaCursor for the result set and remove.
[in] | $condition | The matching rule, return all the documents if null |
[in] | $select | The selective rule, return the whole document if null |
[in] | $orderBy | The ordered rule, never sort if null |
[in] | $hint | The hint, automatically match the optimal hint if null |
[in] | $numToSkip | Skip the first numToSkip documents, never skip if this parameter is 0 |
[in] | $numToReturn | Only return numToReturn documents, return all if this parameter is -1 |
Returns | a SequoiaCursor for the result set |
SequoiaCursor SequoiaCL::findAndUpdate | ( | array|string | $update, |
array|string | $condition = NULL , |
||
array|string | $select = NULL , |
||
array|string | $orderBy = NULL , |
||
array|string | $hint = NULL , |
||
int | $numToSkip = 0 , |
||
int | $numToReturn = -1 , |
||
bool | $returnNew = FALSE |
||
) |
Querys this collection, returning a SequoiaCursor for the result set and update.
[in] | $update | The update rule, can't be null |
[in] | $condition | The matching rule, return all the documents if null |
[in] | $select | The selective rule, return the whole document if null |
[in] | $orderBy | The ordered rule, never sort if null |
[in] | $hint | The hint, automatically match the optimal hint if null |
[in] | $numToSkip | Skip the first numToSkip documents, never skip if this parameter is 0 |
[in] | $numToReturn | Only return numToReturn documents, return all if this parameter is -1 |
[in] | $returnNew | When TRUE, returns the updated document rather than the original |
Returns | a SequoiaCursor for the result set |
string SequoiaCL::getCollectionName | ( | void | ) |
Returns this collection's name.
Returns | the name of this collection |
string SequoiaCL::getCSName | ( | void | ) |
Returns this collection space's name.
Returns | the name of this collection space |
string SequoiaCL::getFullName | ( | void | ) |
Returns this collection full name.
Returns | the name of this collection space |
SequoiaCursor SequoiaCL::getIndex | ( | string | $pIndexName = "" | ) |
Get all of or one of the indexes in current collection.
[in] | $pIndexName | The index name |
Returns | a new SequoiaCursor object |
array string SequoiaCL::insert | ( | array|string | $record | ) |
Inserts an array into the collection.
[in] | $record | a record |
Returns | an array or string of the object id |
array string SequoiaCL::remove | ( | array|string | $condition = NULL , |
array|string | $hint = NULL |
||
) |
Remove records from this collection.
[in] | $condition | condition The matching rule, delete all the documents if null |
[in] | $hint | The hint, automatically match the optimal hint if null |
Returns | the database response |
array string SequoiaCL::split | ( | string | $sourceName, |
string | $destName, | ||
array|string | $condition, | ||
array|string | $endCondition = NULL |
||
) |
data split,source collection split to dest collection
[in] | $sourceName | source collection |
[in] | $destName | dest collection |
[in] | $condition | The matching rule |
[in] | $endCondition | The end of matching rule |
Returns | the database response |
array string SequoiaCL::split | ( | string | $sourceName, |
string | $destName, | ||
double | $percent | ||
) |
data split,source collection split to dest collection
[in] | $sourceName | source collection |
[in] | $destName | dest collection |
[in] | $percent | percentage of split |
Returns | the database response |
int SequoiaCL::truncate | ( | void | ) |
Removes all rows from a collection without logging the individual row deletions.
Returns | the database response |
array string SequoiaCL::update | ( | array|string | $rule, |
array|string | $condition = NULL , |
||
array|string | $hint = NULL |
||
) |
Update the matching documents in current collection.
[in] | $rule | The updating rule, cannot be null |
[in] | $condition | The matching rule, update all the documents if this parameter is null |
[in] | $hint | The hint, automatically match the optimal hint if null |
Returns | the database response |