Public Member Functions | |
drop () | |
getName () | |
selectCL (string $name, array|string $options=null) | |
createCL (string $name, array|string $options=null) | |
getCL (string $name) | |
listCL () | |
dropCL (string $name) | |
renameCL (string $oldName, string $newName, array|string $options=null) | |
alter (array|string $options) | |
setDomain (array|string $options) | |
getDomainName () | |
removeDomain () | |
enableCapped () | |
disableCapped () | |
setAttributes (array|string $options) | |
selectCollection (string $name, array|string $options=NULL) | |
dropCollection (string $name) | |
SequoiaCS Class. To get this Class object must be call SequoiaDB::selectCS or SequoiaDB::getCS.
Class for create an object of the collection space
SequoiaCS::alter | ( | array|string | $options | ) |
Alter the specified collection space.
$options | the array or string argument. The options to alter. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::createCL | ( | string | $name, |
array|string | $options = null |
||
) |
Create the specified collection.
$name | the string argument. The collection name. |
$options | The options are as following: ShardingKey : Assign the sharding key, foramt: { ShardingKey: { <key name>: <1/-1>} },
1 indicates positive order, -1 indicates reverse order.
e.g. array( "ShardingKey" => array( "a" => 1 ) )
ShardingType : Assign the sharding type, default is "hash"
Partition : The number of partition, it is valid when ShardingType is "hash",
the range is [2^3, 2^20], default is 4096
ReplSize : Assign how many replica nodes need to be synchronized when a write
request (insert, update, etc) is executed, default is 1
Compressed : Whether to enable data compression, default is true
CompressionType : The compression type of data, could be "snappy" or "lzw", default is "lzw"
AutoSplit : Whether to enable the automatic partitioning, it is valid when ShardingType
is "hash", defalut is false
Group : Assign the data group to which it belongs, default: The collection will
be created in any data group of the domain that the collection belongs to
AutoIndexId : Whether to build "$id" index, default is true
EnsureShardingIndex : Whether to build sharding index, default is true
StrictDataMode : Whether to enable strict date mode in numeric operations, default is false
AutoIncrement : Assign attributes of an autoincrement field or batch autoincrement fields
e.g. array( "AutoIncrement" => array( "Field" => "a", "MaxValue" => 2000 ) ),
array( "AutoIncrement" => array( array( "Field" => "a", "MaxValue" => 2000 ), array( "Field" => "a", "MaxValue" => 4000 ) ) )
LobShardingKeyFormat : Assign the format of lob sharding key, could be "YYYYMMDD", "YYYYMM" or "YYYY".
It is valid when the collection is main collection
IsMainCL : Main collection or not, default is false, which means it is not main collection
DataSource : The name of the date soure used
Mapping : The name of the collection to be mapped
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
Example: create auto increment collection
SequoiaCS::disableCapped | ( | ) |
Alter the specified collection space to disable capped.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::drop | ( | ) |
Drop collection space.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::dropCL | ( | string | $name | ) |
Drop the specified collection.
$name | the string argument. The collection name. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::dropCollection | ( | string | $name | ) |
Drop the specified collection.
SequoiaCS::enableCapped | ( | ) |
Alter the specified collection space to enable capped.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::getCL | ( | string | $name | ) |
Get the specified collection.
$name | the string argument. The collection name. |
SequoiaCL | Object |
Example:
SequoiaCS::getDomainName | ( | ) |
Get the Domain name of current collection space.
string | <domain_name> or NULL |
Example:
SequoiaCS::getName | ( | ) |
Get the specified collection space name.
string | <cs_name> |
Example:
SequoiaCS::listCL | ( | ) |
List all collections in current collection space.
SequoiaCursor | object or NULL. |
Example:
SequoiaCS::removeDomain | ( | ) |
Alter the specified collection space to remove domain.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::renameCL | ( | string | $oldName, |
string | $newName, | ||
array|string | $options = null |
||
) |
Rename collection name
$oldName | The old collection name |
$newName | The new collection name |
$options | Reserved |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::selectCL | ( | string | $name, |
array|string | $options = null |
||
) |
Get the specified collection, if is not exist, will auto create.
$name | the string argument. The collection name. |
$options | an array or the string argument. Please reference here to get the $options's info of create collection. |
SequoiaCL | Object |
Example:
Example: create auto increment collection
SequoiaCS::selectCollection | ( | string | $name, |
array|string | $options = NULL |
||
) |
Get the specified collection, if is not exist,will auto create.
SequoiaCS::setAttributes | ( | array|string | $options | ) |
Alter the specified collection space.
$options | the array or string argument. The options to alter. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaCS::setDomain | ( | array|string | $options | ) |
Alter the specified collection space to set domain.
$options | the array or string argument. The options to alter. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: