Public Member Functions | |
__construct (array|string $address, string $userName="", string $password="", boolean $useSSL=false) | |
install (array|string $options=null) | |
getError () | |
connect (array|string $address="127.0.0.1:11810", string $userName="", string $password="", boolean $useSSL=false) | |
close () | |
isValid () | |
syncDB (array|string $options=null) | |
snapshot (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null, integer $numToSkip=0, integer $numToReturn=-1) | |
resetSnapshot (array|string $condition=null) | |
list (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null, integer $numToSkip=0, integer $numToReturn=-1) | |
listCS (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
selectCS (string $name, array|string $options=null) | |
selectCS (string $name, integer $pageSize=null) | |
createCS (string $name, array|string $options=null) | |
getCS (string $name) | |
dropCS (string $name) | |
listCL (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
getCL (string $fullName) | |
truncate (string $fullName) | |
listDomain (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
createDomain (string $name, array|string $options=null) | |
getDomain (string $name) | |
dropDomain (string $name) | |
listGroup (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
getGroup (string $name) | |
createGroup (string $name) | |
removeGroup (string $name) | |
createCataGroup (string $hostName, string $serviceName, string $databasePath, array|string $configure=null) | |
execSQL (string $sql) | |
execUpdateSQL (string $sql) | |
createUser (string $userName, string $passwd) | |
removeUser (string $userName, string $passwd) | |
flushConfigure (array|string $options) | |
listProcedure (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
createJsProcedure (string $code) | |
removeProcedure (string $name) | |
evalJs (string $code) | |
transactionBegin () | |
transactionCommit () | |
transactionRollback () | |
backupOffline (array|string $options) | |
listBackup (array|string $options, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
removeBackup (array|string $options) | |
listTask (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
waitTask (array|integer|SequoiaInt64 $taskID) | |
cancelTask (integer|SequoiaInt64 $taskID, boolean $isAsync=true) | |
setSessionAttr (array|string $options) | |
getSessionAttr () | |
forceSession (integer|SequoiaINT64 $sessionID, array|string $options=null) | |
getList (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null) | |
getSnapshot (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null) | |
selectCS (string $name, integer $pageSize=4096) | |
listCSs () | |
dropCollectionSpace (string $name) | |
listCollections () | |
listDomains () | |
selectGroup (string $name) | |
Public Attributes | |
const | SDB_SNAP_CONTEXTS 0 |
const | SDB_SNAP_CONTEXTS_CURRENT 1 |
const | SDB_SNAP_SESSIONS 2 |
const | SDB_SNAP_SESSIONS_CURRENT 3 |
const | SDB_SNAP_COLLECTIONS 4 |
const | SDB_SNAP_COLLECTIONSPACES 5 |
const | SDB_SNAP_DATABASE 6 |
const | SDB_SNAP_SYSTEM 7 |
const | SDB_SNAP_CATALOG 8 |
const | SDB_SNAP_TRANSACTIONS 9 |
const | SDB_SNAP_TRANSACTIONS_CURRENT 10 |
const | SDB_SNAP_COLLECTION 4 |
const | SDB_SNAP_COLLECTIONSPACE 5 |
const | SDB_SNAP_CATA 8 |
const | SDB_SNAP_TRANSACTION 9 |
const | SDB_SNAP_TRANSACTION_CURRENT 10 |
const | SDB_LIST_CONTEXTS 0 |
const | SDB_LIST_CONTEXTS_CURRENT 1 |
const | SDB_LIST_SESSIONS 2 |
const | SDB_LIST_SESSIONS_CURRENT 3 |
const | SDB_LIST_COLLECTIONS 4 |
const | SDB_LIST_COLLECTIONSPACES 5 |
const | SDB_LIST_STORAGEUNITS 6 |
const | SDB_LIST_GROUPS 7 |
const | SDB_LIST_STOREPROCEDURES 8 |
const | SDB_LIST_DOMAINS 9 |
const | SDB_LIST_TASKS 10 |
const | SDB_LIST_TRANSACTIONS 11 |
const | SDB_LIST_TRANSACTIONS_CURRENT 12 |
const | SDB_LIST_USERS 16 |
const | SDB_LIST_CL_IN_DOMAIN 129 |
const | SDB_LIST_CS_IN_DOMAIN 130 |
Class for create an object of the db
SequoiaDB::__construct | ( | array|string | $address, |
string | $userName = "" , |
||
string | $password = "" , |
||
boolean | $useSSL = false |
||
) |
SequoiaDB class constructor.
$address | an array or the string argument. The Host Name or IP Address and The Service Name or Port of Database Server. |
$userName | the string argument. The User's Name of the account. |
$password | the string argument. The Password of the account. |
$useSSL | a boolean argument. Connect to database with ssl. |
Example: 1. Using the connect function to connect to the database.
Example: 2. Connect to the database.
Example: 3. Connect to the database, using the default service name. The default service name is 11810.
Example: 4. Connect to the running database one.
Example: 5. Connect to the authentication database.
Example: 6. Connect to the running authentication database one.
Example: 7. Connect to the database with ssl.
Example: 8. Using the connect function to connect to the database with ssl.
Example: 9. Connect to the database with ssl.
SequoiaDB::backupOffline | ( | array|string | $options | ) |
Backup the whole database or specifed replica group.
$options | an array or the string argument. Contains a series of backup configuration infomations. Backup the whole cluster if null. The "options" contains 5 options as below. All the elements in options are optional. e.g. array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName', 'Description' => 'It is my backup', 'EnsureInc' => true, 'OverWrite' => true )
GroupID : The id(s) of replica group(s) which to be backuped
GroupName : The replica groups which to be backuped
Path : The backup path, if not assign, use the backup path assigned in the configuration file,
the path support to use wildcard(%g/%G:group name, %h/%H:host name, %s/%S:service name).
e.g.
array( 'Path' => '/opt/sequoiadb/backup/%g' )
isSubDir : Whether the path specified by paramer "Path" is a subdirectory of the path specified in the configuration file, default to be false
Name : The name for the backup
Prefix : The prefix of name for the backup, default to be null.
e.g.
array( 'Prefix' => '%g_bk_' )
EnableDateDir : Whether turn on the feature which will create subdirectory named to current date like "YYYY-MM-DD" automatically, default to be false
Description : The description for the backup
EnsureInc : Whether excute increment synchronization, default to be false
OverWrite : Whether overwrite the old backup file, default to be false
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::cancelTask | ( | integer|SequoiaInt64 | $taskID, |
boolean | $isAsync = true |
||
) |
Cancel the specified task.
$taskID | an integer argument. The task id. |
$isAsync | a boolean argument. The operation "cancel task" is async or not, "true" for async, "false" for sync. Default sync. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::close | ( | ) |
SequoiaDB::connect | ( | array|string | $address = "127.0.0.1:11810" , |
string | $userName = "" , |
||
string | $password = "" , |
||
boolean | $useSSL = false |
||
) |
Connect to database.
$address | an array or the string argument. The Host Name or IP Address and The Service Name or Port of Database Server. |
$userName | the string argument. The User's Name of the account. |
$password | the string argument. The Password of the account. |
$useSSL | a boolean argument. Connect to database with ssl. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: 1. Connect to the default address of the database. The default address is 127.0.0.1:11810.
Example: 2. Connect to the database.
Example: 3. Connect to the database, using the default service name. The default service name is 11810.
Example: 4. Connect to the running database one.
Example: 5. Connect to the authentication database.
Example: 6. Connect to the running authentication database one.
Example: 7. Connect to the database with ssl.
SequoiaDB::createCataGroup | ( | string | $hostName, |
string | $serviceName, | ||
string | $databasePath, | ||
array|string | $configure = null |
||
) |
Create a catalog replica group.
$hostName | the string argument. The hostname for the catalog replica group. |
$serviceName | the string argument. The servicename for the catalog replica group. |
$databasePath | the string argument. The path for the catalog replica group. |
$configure | the string argument. The configurations for the catalog replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createCS | ( | string | $name, |
array|string | $options = null |
||
) |
Create the specified collection space.
$name | the string argument. The collection space name. |
$options | an array or the string argument. The options specified by use. e.g. array( 'PageSize' => 4096, 'Domain' => 'myDomain' )
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createDomain | ( | string | $name, |
array|string | $options = null |
||
) |
Create a domain.
$name | the string argument. The name of the domain. |
$options | an array or the string argument. The options for the domain. The options are as below: Groups : The list of replica groups names which the domain is going to contain.
eg: array( 'Groups' => array( "group1", "group2", "group3" ) )
If this argument is not included, the domain will contain all replica groups in the cluster.
AutoSplit : If this option is set to be true, while creating collection(ShardingType is "hash") in this domain,
the data of this collection will be split(hash split) into all the groups in this domain automatically.
However, it not automatically split data into those groups which were add into this domain later.
eg: array( 'Groups' => array( "group1", "group2", "group3" ), 'AutoSplit' => true )
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createGroup | ( | string | $name | ) |
Create the specified replica group.
$name | the string argument. The name of the replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createJsProcedure | ( | string | $code | ) |
Create a store procedure.
$code | the string argument. The code of store procedures. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createUser | ( | string | $userName, |
string | $passwd | ||
) |
Create an account.
$userName | the string argument. The user name of the account. |
$passwd | the string argument. The password of the account. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::dropCollectionSpace | ( | string | $name | ) |
Drop the specified collection space.
SequoiaDB::dropCS | ( | string | $name | ) |
Drop the specified collection space.
$name | the string argument. The collection space name. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::dropDomain | ( | string | $name | ) |
Drop a domain.
$name | the string argument. The name of the domain. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::evalJs | ( | string | $code | ) |
Eval javascript code.
$code | the string argument. The code to eval. |
void | |
string | |
integer | |
SequoiaINT64 | |
double | |
array | record |
string | record |
boolean | |
SequoiaCursor | Object |
SequoiaCS | Object |
SequoiaCL | Object |
SequoiaGroup | Object |
SequoiaNode | Object |
Example:
SequoiaDB::execSQL | ( | string | $sql | ) |
Executing SQL command.
$sql | the string argument. The SQL command. |
SequoiaCursor | Object |
Example:
SequoiaDB::execUpdateSQL | ( | string | $sql | ) |
Executing SQL command for updating.
$sql | the string argument. The SQL command. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::flushConfigure | ( | array|string | $options | ) |
Flush the options to configure file.
$options | an array or the string argument. The configure infomation. e.g. array( 'Global' => true )
Global : In cluster environment, passing array( 'Global' => true ) will flush data and catalog configuration file, while passing array( 'Global' => false ) will flush coord configuration file.
In stand-alone environment, both them have the same behaviour.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::forceSession | ( | integer|SequoiaINT64 | $sessionID, |
array|string | $options = null |
||
) |
Interrupte the session.
$sessionID | an integer or the SequoiaINT64 Object argument. The id of the session which we want to inerrupt. |
$options | an array or the string argument. The location information, such as NodeID, HostName and svcname. the options are as below: HostName: Node's HostName.
svcname: Node's svcname.
NodeID: Node ID.
GroupID: Replica group ID.
GroupName: Replica group name.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: integer type
Example: SequoiaINT64 type
Example: Force specified node session
SequoiaDB::getCL | ( | string | $fullName | ) |
Get the specified collection.
$fullName | the string argument. The collection full name. |
SequoiaCL | Object |
Example:
SequoiaDB::getCS | ( | string | $name | ) |
Get the specified collection space.
$name | the string argument. The collection space name. |
SequoiaCS | Object |
Example:
SequoiaDB::getDomain | ( | string | $name | ) |
Get a domain.
$name | the string argument. The name of the domain. |
SequoiaDomain | Object |
Example:
SequoiaDB::getError | ( | ) |
When function return value is result, the return content contains the error code. but a small part of function does not return an error code, So you can call getError() to retrieve the error code.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::getGroup | ( | string | $name | ) |
Get the specified replica group.
SequoiaGroup | Object |
Example:
SequoiaDB::getList | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null |
||
) |
Get the specified list.
SequoiaDB::getSessionAttr | ( | ) |
Get the attributes of the session.
array | result |
string | result |
Example:
SequoiaDB::getSnapshot | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null |
||
) |
Get the snapshot.
SequoiaDB::install | ( | array|string | $options = null | ) |
SequoiaDB class constructor.
$options | an array or the string argument. Set driver options and return the current options. the options are as below: The default is true, return an array;
set the false, return the string.
|
array | array( 'install' => true ) |
string | { "install": false } |
Example: 1. Set to return an array type
Example: 2. Set to return the string type
Example: 3. Get the driver current options
SequoiaDB::isValid | ( | ) |
Judge whether the connection is valid.
boolean | isConnect |
Example:
SequoiaDB::list | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null , |
||
integer | $numToSkip = 0 , |
||
integer | $numToReturn = -1 |
||
) |
Get the specified list.
$type | an integer argument. The list type as below: |
$condition | an array or the string argument. The matching rule, match all the documents if null. |
$selector | an array or the string argument. The selective rule, return the whole document if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved. |
$numToSkip | an integer argument. Skip the first numToSkip records, never skip if this parameter is 0. |
$numToReturn | an integer argument. Only return numToReturn records, return all if this parameter is -1. |
SequoiaCursor | Object |
Example:
SequoiaDB::listBackup | ( | array|string | $options, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the backups.
$options | an array or the string argument. Contains configuration infomations for remove backups, list all the backups in the default backup path if null. The "options" contains 3 options as below. All the elements in options are optional. e.g. array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName' )
|
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCL | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all collection of current database(not include temporary collection of temporary collection space)
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCollections | ( | ) |
List all collection of current database(not include temporary collection of temporary collection space)
SequoiaDB::listCS | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all collection space of current database(include temporary collection space)
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCSs | ( | ) |
Get the specified list.
SequoiaDB::listDomain | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the domain.
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listDomains | ( | ) |
List the domain.
SequoiaDB::listGroup | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all the replica groups of current database.
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listProcedure | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List store procedures.
$condition | an array or the string argument. The condition of list. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listTask | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the tasks.
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The The ordered rule, never sort if null. |
$hint | an array or the string argument. The hint, automatically match the optimal hint if null. |
SequoiaCursor | Object |
Example:
SequoiaDB::removeBackup | ( | array|string | $options | ) |
Remove the backups.
$options | an array or the string argument. Contains configuration infomations for remove backups, list all the backups in the default backup path if null. The "options" contains 3 options as below. All the elements in options are optional. eg: array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName' ) GroupName : Assign the backups of specifed replica groups to be list
Path : Assign the backups in specifed path to be list, if not assign, use the backup path asigned in the configuration file
Name : Assign the backups with specifed name to be list
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeGroup | ( | string | $name | ) |
Remove the specified replica group.
$name | the string argument. The name of the replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeProcedure | ( | string | $name | ) |
Remove a store procedure.
$name | the string argument. The name of store procedure. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeUser | ( | string | $userName, |
string | $passwd | ||
) |
Delete an account.
$userName | the string argument. The user name of the account. |
$passwd | the string argument. The password of the account. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::resetSnapshot | ( | array|string | $condition = null | ) |
Reset the snapshot.
$condition | The control options are as below:(please visit the official website to search "Location Elements" for more detail.) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String... |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::selectCS | ( | string | $name, |
integer | $pageSize = 4096 |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$pageSize | an integer argument. When the collection space is created, $pageSize into force. The $pageSize as below: 4096
8192
16384
32768
65536
|
SequoiaCS | Object |
Example:
SequoiaDB::selectCS | ( | string | $name, |
array|string | $options = null |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$options | an array or the string argument. When the collection space is created, $options into force. The options specified by use. e.g. array( 'PageSize' => 4096, 'Domain' => 'mydomain' )
|
SequoiaCS | Object |
Example:
SequoiaDB::selectCS | ( | string | $name, |
integer | $pageSize = null |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$pageSize | an integer argument. Assign the pagesize of the collection space. |
SequoiaCS | Object |
Example:
SequoiaDB::selectGroup | ( | string | $name | ) |
Get the specified replica group.
SequoiaDB::setSessionAttr | ( | array|string | $options | ) |
Set the attributes of the session.
$options | an array or the string argument. The configuration options for session.The options are as below: PreferedInstance : Preferred instance for read request in the current session. Could be single value in 'M', 'm', 'S', 's', 'A', 'a', 1-255, or BSON Array to include multiple values.
"M", "m": read and write instance( master instance ). If multiple numeric instances are given with "M", matched master instance will be chosen in higher priority. If multiple numeric instances are given with "M" or "m", master instance will be chosen if no numeric instance is matched.
"S", "s": read only instance( slave instance ). If multiple numeric instances are given with "S", matched slave instances will be chosen in higher priority. If multiple numeric instances are given with "S" or "s", slave instance will be chosen if no numeric instance is matched.
'A', 'a': any instance.
1-255: the instance with specified instance ID.
If multiple alphabet instances are given, only first one will be used.
If matched instance is not found, will choose instance by random.
e.g. array( 'PreferedInstance' => 'm' ) or array( 'PreferedInstance' => array( 1, 7 ) )
PreferedInstanceMode : The mode to choose query instance when multiple preferred instances are found in the current session.
'random': choose the instance from matched instances by random.
'ordered': choose the instance from matched instances by the order of "PreferedInstance".
e.g. array( 'PreferedInstanceMode' => 'random' )
Timeout : The timeout (in ms) for operations in the current session. -1 means no timeout for operations.
e.g. array( 'Timeout' => 10000 )
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::snapshot | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null , |
||
integer | $numToSkip = 0 , |
||
integer | $numToReturn = -1 |
||
) |
Get the snapshot.
$type | an integer argument. The snapshot type as below: |
$condition | an array or the string argument. The matching rule, match all the documents if null. |
$selector | an array or the string argument. The selective rule, return the whole document if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved. |
$numToSkip | an integer argument. This parameter is reserved. |
$numToReturn | an integer argument. This parameter is reserved. |
SequoiaCursor | Object |
Example:
SequoiaDB::syncDB | ( | array|string | $options = null | ) |
Sync database which are specified.
$options | an array or the string argument. The control options: Deep : (INT32) Flush with deep mode or not. 1 in default. 0 for non-deep mode,1 for deep mode,-1 means use the configuration with server.
Block : (Bool) Flush with block mode or not. false in default.
CollectionSpace : (String) Specify the collectionspace to sync. If not set, will sync all the collectionspaces and logs, otherwise, will only sync the collectionspace specified.
Location Elements : (Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String ...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionBegin | ( | ) |
Transaction begin.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionCommit | ( | ) |
Transaction commit.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionRollback | ( | ) |
Transaction rollback.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::truncate | ( | string | $fullName | ) |
Truncate the collection.
$fullName | the string argument. The collection full name. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::waitTask | ( | array|integer|SequoiaInt64 | $taskID | ) |
Remove the backups.
$taskID | an array or an integer argument. The array of task id or the integer of task id ; |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: array type
Example: integer type
Example: SequoiaInt64 type
const SequoiaDB::SDB_LIST_CL_IN_DOMAIN 129 |
Get the list of the collections in specified domain.
const SequoiaDB::SDB_LIST_COLLECTIONS 4 |
Get the list of the collections.
const SequoiaDB::SDB_LIST_COLLECTIONSPACES 5 |
Get the list of the collecion spaces.
const SequoiaDB::SDB_LIST_CONTEXTS 0 |
Get the list of the contexts.
const SequoiaDB::SDB_LIST_CONTEXTS_CURRENT 1 |
Get the list of current context.
const SequoiaDB::SDB_LIST_CS_IN_DOMAIN 130 |
Get the list of the collection spaces in specified domain.
const SequoiaDB::SDB_LIST_DOMAINS 9 |
Get the list of the domains ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_GROUPS 7 |
Get the list of the replica groups ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_SESSIONS 2 |
Get the list of the sessions.
const SequoiaDB::SDB_LIST_SESSIONS_CURRENT 3 |
Get the list of current session.
const SequoiaDB::SDB_LIST_STORAGEUNITS 6 |
Get the list of the storage units.
const SequoiaDB::SDB_LIST_STOREPROCEDURES 8 |
Get the list of the stored procedures ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_TASKS 10 |
Get the list of the tasks ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_TRANSACTIONS 11 |
Get all the transactions information.
const SequoiaDB::SDB_LIST_TRANSACTIONS_CURRENT 12 |
Get the transactions information of current session.
const SequoiaDB::SDB_LIST_USERS 16 |
Get the list of users.
const SequoiaDB::SDB_SNAP_CATA 8 |
const SequoiaDB::SDB_SNAP_CATALOG 8 |
Get the snapshot of the catalog.
const SequoiaDB::SDB_SNAP_COLLECTION 4 |
const SequoiaDB::SDB_SNAP_COLLECTIONS 4 |
Get the snapshot of all the collections.
const SequoiaDB::SDB_SNAP_COLLECTIONSPACE 5 |
const SequoiaDB::SDB_SNAP_COLLECTIONSPACES 5 |
Get the snapshot of all the collection spaces.
const SequoiaDB::SDB_SNAP_CONTEXTS 0 |
Get the snapshot of all the contexts.
const SequoiaDB::SDB_SNAP_CONTEXTS_CURRENT 1 |
Get the snapshot of current context
const SequoiaDB::SDB_SNAP_DATABASE 6 |
Get the snapshot of the database.
const SequoiaDB::SDB_SNAP_SESSIONS 2 |
Get the snapshot of all the sessions.
const SequoiaDB::SDB_SNAP_SESSIONS_CURRENT 3 |
Get the snapshot of current session.
const SequoiaDB::SDB_SNAP_SYSTEM 7 |
Get the snapshot of the system.
const SequoiaDB::SDB_SNAP_TRANSACTION 9 |
const SequoiaDB::SDB_SNAP_TRANSACTION_CURRENT 10 |
const SequoiaDB::SDB_SNAP_TRANSACTIONS 9 |
Get the snapshot of all the transactions.
const SequoiaDB::SDB_SNAP_TRANSACTIONS_CURRENT 10 |
Get the snapshot of current transaction.