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.
- Parameters
-
$options | the array or string argument. The options to alter. |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
$err = $cs ->
alter( array(
'PageSize' => 4096 ) ;
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::createCL |
( |
string |
$name, |
|
|
array|string |
$options = null |
|
) |
| |
Create the specified collection.
- Parameters
-
$name | the string argument. The collection name. |
$options | an array or the string argument. The $options for creating collection. Please reference here for more detail. |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
$err = $cs ->
createCL(
'bar', array(
'Compressed' =>
true ) ) ;
if( $err['errno'] != 0 ) {
echo "Failed to create collection, error code: ".$err['errno'] ;
return ;
}
Example: create auto increment collection
$err = $cs ->
createCL(
'bar', array(
'AutoIncrement' => array(
'Field' =>
'a',
'MaxValue' => 20000 ) ) ) ;
if( $err['errno'] != 0 ) {
echo "Failed to create collection, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::disableCapped |
( |
| ) |
|
Alter the specified collection space to disable capped.
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
Drop collection space.
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
if( $err['errno'] != 0 ) {
echo "Failed to drop collection space, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::dropCL |
( |
string |
$name | ) |
|
Drop the specified collection.
- Parameters
-
$name | the string argument. The collection name. |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
$err = $cs ->
dropCL(
'bar' ) ;
if( $err['errno'] != 0 ) {
echo "Failed to drop collection, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::dropCollection |
( |
string |
$name | ) |
|
SequoiaCS::enableCapped |
( |
| ) |
|
Alter the specified collection space to enable capped.
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::getCL |
( |
string |
$name | ) |
|
Get the specified collection.
- Parameters
-
$name | the string argument. The collection name. |
- Returns
- Returns a new SequoiaCL object.
- Return values
-
Example:
$cl = $cs ->
getCL(
'bar' ) ;
if( empty( $cl ) ) {
$err = $db -> getLastErrorMsg() ;
echo "Failed to call getCL, error code: ".$err['errno'] ;
return ;
}
Get the specified collection space name.
- Returns
- Returns the collection space name.
- Return values
-
Example:
$err = $db -> getLastErrorMsg() ;
if( $err['errno'] != 0 ) {
echo "Failed to get collection space name, error code: ".$err['errno'] ;
return ;
}
echo "Collection space name is: ".$csName ;
SequoiaCS::removeDomain |
( |
| ) |
|
Alter the specified collection space to remove domain.
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::renameCL |
( |
string |
$oldName, |
|
|
string |
$newName, |
|
|
array|string |
$options = null |
|
) |
| |
Rename collection name
- Parameters
-
$oldName | The old collection name |
$newName | The new collection name |
$options | Reserved |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
$err = $cs ->
renameCL(
'bar',
'new_bar' ) ;
if( $err['errno'] != 0 ) {
echo "Failed to rename collection, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::selectCL |
( |
string |
$name, |
|
|
array|string |
$options = null |
|
) |
| |
Get the specified collection, if is not exist, will auto create.
- Parameters
-
$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. |
- Returns
- Returns a new SequoiaCL object.
- Return values
-
Example:
$cl = $cs ->
selectCL(
'bar', array(
'Compressed' =>
true ) ) ;
if( empty( $cl ) ) {
$err = $db -> getLastErrorMsg() ;
echo "Failed to call selectCL, error code: ".$err['errno'] ;
return ;
}
Example: create auto increment collection
$err = $cs ->
selectCL(
'bar', array(
'AutoIncrement' => array(
'Field' =>
'a',
'MaxValue' => 20000 ) ) ) ;
if( $err['errno'] != 0 ) {
echo "Failed to call selectCL, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::selectCollection |
( |
string |
$name, |
|
|
array|string |
$options = NULL |
|
) |
| |
Get the specified collection, if is not exist,will auto create.
- See Also
- selectCL().
- Deprecated:
- This function is deprecated, use the function selectCL() instead.
SequoiaCS::setAttributes |
( |
array|string |
$options | ) |
|
Alter the specified collection space.
- Parameters
-
$options | the array or string argument. The options to alter. |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
SequoiaCS::setDomain |
( |
array|string |
$options | ) |
|
Alter the specified collection space to set domain.
- Parameters
-
$options | the array or string argument. The options to alter. |
- Returns
- Returns the result, default return array.
- Return values
-
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
$err = $cs ->
setDomain( array(
'Domain' =>
'domain' ) ;
if( $err['errno'] != 0 ) {
echo "Failed to alter collection space, error code: ".$err['errno'] ;
return ;
}
The documentation for this class was generated from the following files: