SequoiaDB
|
Database operation interfaces of collection space. More...
#include <client.hpp>
Public Member Functions | |
sdbCollectionSpace () | |
Default constructor. | |
~sdbCollectionSpace () | |
Destructor. | |
INT32 | getCollection (const CHAR *pCollectionName, sdbCollection &collection, BOOLEAN checkExist=TRUE) |
Get the named collection. | |
INT32 | createCollection (const CHAR *pCollection, const bson::BSONObj &options, sdbCollection &collection) |
Create the specified collection in current collection space with options. | |
INT32 | createCollection (const CHAR *pCollection, sdbCollection &collection) |
Create the specified collection in current collection space without sharding key and default ReplSize. | |
INT32 | dropCollection (const CHAR *pCollection) |
Drop the specified collection in current collection space. | |
INT32 | listCollections (_sdbCursor **cursor) |
list all collections in current collection space. | |
INT32 | listCollections (sdbCursor &cursor) |
list all collections in current collection space. | |
INT32 | create () |
Create a new collection space. | |
INT32 | drop () |
Drop current collection space. | |
const CHAR * | getCSName () |
Get the current collection space name. | |
INT32 | renameCollection (const CHAR *oldName, const CHAR *newName, const bson::BSONObj &options=_sdbStaticObject) |
Rename collection. | |
INT32 | alterCollectionSpace (const bson::BSONObj &options) |
Alter collection space. | |
INT32 | setDomain (const bson::BSONObj &options) |
Alter collection space to set domain. | |
INT32 | getDomainName (CHAR *result, INT32 resultLen) |
get the Domain name in current collection space. | |
INT32 | removeDomain () |
Alter collection space to remove domain. | |
INT32 | enableCapped () |
Alter collection space to enable capped. | |
INT32 | disableCapped () |
Alter collection space to disable capped. | |
INT32 | setAttributes (const bson::BSONObj &options) |
Alter collection space. | |
Public Attributes | |
_sdbCollectionSpace * | pCollectionSpace |
Database operation interfaces of collection space.
|
inline |
Alter collection space.
[in] | options | The options of collection space to be changed, e.g. { "PageSize": 4096, "Domain": "mydomain" }. PageSize : The page size of the collection space LobPageSize : The page size of LOB objects in the collection space Domain : The domain which the collection space belongs to |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create a new collection space.
SDB_OK | Operation Success. |
Others | Operation Fail |
|
inline |
Create the specified collection in current collection space with options.
[in] | pCollection | The collection name |
[in] | 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. { ShardingKey: { age: 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. { AutoIncrement : { Field : "a", MaxValue : 2000 } }, { AutoIncrement : [ { Field : "a", MaxValue : 2000}, { 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 |
[out] | collection | The return collection object . |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create the specified collection in current collection space without sharding key and default ReplSize.
[in] | pCollection | The collection name. |
[out] | collection | The return collection object. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter collection space to disable capped.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Drop current collection space.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Drop the specified collection in current collection space.
[in] | pCollection | The collection name. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter collection space to enable capped.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the named collection.
[in] | pCollectionName | The full name of the collection. |
[in] | checkExist | Check if the collection exists, default is true. |
[out] | collection | The return collection object. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the current collection space name.
|
inline |
get the Domain name in current collection space.
[out] | result | Returned domain name in the collection space |
[in] | resultLen | The length of the result to get the domain name |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
list all collections in current collection space.
[out] | cursor | The sdbCursor object of result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
list all collections in current collection space.
[out] | cursor | The sdbCursor object of result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter collection space to remove domain.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Rename collection.
[in] | oldName | The old name of collectionSpace. |
[in] | newName | The new name of collectionSpace. |
[in] | options | Reserved argument |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter collection space.
[in] | options | The options of collection space to be changed, e.g. { "PageSize": 4096, "Domain": "mydomain" }. PageSize : The page size of the collection space LobPageSize : The page size of LOB objects in the collection space Domain : The domain which the collection space belongs to |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter collection space to set domain.
[in] | options | The options of collection space to be changed. Domain : The domain which the collection space belongs to |
SDB_OK | Operation Success |
Others | Operation Fail |
sdbclient::sdbCollectionSpace::pCollectionSpace |
A pointer of virtual base class _sdbCollectionSpace
Class sdbCollectionSpace is a shell for _sdbCollectionSpace. We use pCollectionSpace to call the methods in class _sdbCollectionSpace.