SequoiaDB
 All Classes Namespaces Functions Variables Enumerations Properties Pages
Public Member Functions | Properties | List of all members
SequoiaDB.DBCollection Class Reference

Database operation interfaces of collection. More...

Public Member Functions

void Split (string sourceGroupName, string destGroupName, BsonDocument splitCondition, BsonDocument splitEndCondition)
 Split the collection from one group into another group by range.
 
void Split (string sourceGroupName, string destGroupName, double percent)
 Split the collection from one group into another group by percent.
 
long SplitAsync (String sourceGroupName, String destGroupName, BsonDocument splitCondition, BsonDocument splitEndCondition)
 Split the specified collection from source group to target group by range asynchronously.
 
long SplitAsync (String sourceGroupName, String destGroupName, double percent)
 Split the specified collection from source group to target group by percent asynchronously.
 
BsonValue Insert (BsonDocument record)
 Insert a document into current collection.
 
void BulkInsert (List< BsonDocument > records, int flag)
 Insert a bulk of bson objects into current collection.
 
void Delete (BsonDocument matcher)
 Delete the matching document of current collection.
 
void Delete (BsonDocument matcher, BsonDocument hint)
 Delete the matching document of current collection.
 
void Update (DBQuery query)
 Update the document of current collection.
 
void Update (BsonDocument matcher, BsonDocument modifier, BsonDocument hint)
 Update the document of current collection.
 
void Upsert (BsonDocument matcher, BsonDocument modifier, BsonDocument hint)
 Update the document of current collection, insert if no matching.
 
void Upsert (BsonDocument matcher, BsonDocument modifier, BsonDocument hint, BsonDocument setOnInsert)
 Update the document of current collection, insert if no matching.
 
DBCursor Query ()
 Find all documents of current collection.
 
DBCursor Query (DBQuery query)
 Find documents of current collection with DBQuery.
 
DBCursor Query (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint)
 Find documents of current collection.
 
DBCursor Query (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows)
 Find documents of current collection.
 
DBCursor Query (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows, int flag)
 Find documents of current collection.
 
DBCursor _Query (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows, int flag)
 
DBCursor QueryAndUpdate (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, BsonDocument update, long skipRows, long returnRows, int flag, bool returnNew)
 Find documents of current collection and update.
 
DBCursor QueryAndRemove (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows, int flag)
 Find documents of current collection and remove.
 
DBCursor Explain (BsonDocument query, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows, int flag, BsonDocument options)
 Find documents of current collection.
 
DBCursor GetIndexes ()
 Get all the indexes of current collection.
 
DBCursor GetIndex (string name)
 Get the named index of current collection.
 
void CreateIndex (string name, BsonDocument key, bool isUnique, bool isEnforced)
 Create a index with name and key.
 
void CreateIndex (string name, BsonDocument key, bool isUnique, bool isEnforced, int sortBufferSize)
 Specify sort buffer size to create a index.
 
void DropIndex (string name)
 Remove the named index of current collection.
 
long GetCount (BsonDocument matcher, BsonDocument hint)
 Get the count of matching documents in current collection.
 
long GetCount (BsonDocument matcher)
 Get the count of matching documents in current collection.
 
DBCursor Aggregate (List< BsonDocument > obj)
 Execute aggregate operation in specified collection.
 
DBCursor GetQueryMeta (BsonDocument query, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows)
 Get the index blocks' or data blocks' infomations for concurrent query.
 
void AttachCollection (string subClFullName, BsonDocument options)
 Attach the specified collection.
 
void DetachCollection (string subClFullName)
 Detach the specified collection.
 
void Alter (BsonDocument options)
 Alter the attributes of current collection.
 
DBCursor ListLobs ()
 List all of the lobs in current collection.
 
DBLob CreateLob ()
 Create a large object.
 
DBLob CreateLob (ObjectId id)
 Create a large object with specified oid.
 
DBLob OpenLob (ObjectId id)
 Open an existing lob with the speceifed oid.
 
void RemoveLob (ObjectId id)
 Remove an existing lob with the speceifed oid.
 
void Truncate ()
 Truncate the collection.
 
void CreateIdIndex (BsonDocument options)
 Create $id index in collection.
 
void DropIdIndex ()
 Drop $id index in collection.
 

Properties

bool EnsureOID [get, set]
 Get or set whether insert oid in records when bulk insert.
 
string Name [get]
 Return the name of current collection.
 
string FullName [get]
 Return the full name of current collection.
 
CollectionSpace CollSpace [get]
 

Detailed Description

Database operation interfaces of collection.

Member Function Documentation

DBCursor SequoiaDB.DBCollection.Aggregate ( List< BsonDocument obj)
inline

Execute aggregate operation in specified collection.

Parameters
insertorThe array of bson objects, can't be null
Returns
The DBCursor of result or null
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Alter ( BsonDocument  options)
inline

Alter the attributes of current collection.

Parameters
optionsThe options for altering current collection:
ReplSize     : Assign how many replica nodes need to be synchronized when a write request(insert, update, etc) is executed
ShardingKey  : Assign the sharding key
ShardingType : Assign the sharding type
Partition    : When the ShardingType is "hash", need to assign Partition, it's the bucket number for hash, the range is [2^3,2^20]
               e.g. {RepliSize:0, ShardingKey:{a:1}, ShardingType:"hash", Partition:1024}
Note
Can't alter attributes about split in partition collection; After altering a collection to be a partition collection, need to split this collection manually
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.AttachCollection ( string  subClFullName,
BsonDocument  options 
)
inline

Attach the specified collection.

Parameters
subClFullNameThe name of the subcollection
optionsThe low boudary and up boudary eg: {"LowBound":{a:1},"UpBound":{a:100}}
Return values
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.BulkInsert ( List< BsonDocument records,
int  flag 
)
inline

Insert a bulk of bson objects into current collection.

Parameters
recordsThe Bson document of insertor list, can't be null
flagSDBConst.FLG_INSERT_CONTONDUP or 0
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.CreateIdIndex ( BsonDocument  options)
inline

Create $id index in collection.

Parameters
optionsOptions for create id index, or null for no options, see SequoiaDB Information Center "SequoiaDB Shell Methods" for more detail. e.g.: {"Offline":true}
  • Offline : Use offline mode to create index or not, default to be false
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.CreateIndex ( string  name,
BsonDocument  key,
bool  isUnique,
bool  isEnforced 
)
inline

Create a index with name and key.

Parameters
nameThe index name
keyThe index key
isUniqueWhether the index elements are unique or not
isEnforcedWhether the index is enforced unique. This element is meaningful when isUnique is group to true.
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.CreateIndex ( string  name,
BsonDocument  key,
bool  isUnique,
bool  isEnforced,
int  sortBufferSize 
)
inline

Specify sort buffer size to create a index.

Parameters
nameThe index name
keyThe index key
isUniqueWhether the index elements are unique or not
isEnforcedWhether the index is enforced unique. This element is meaningful when isUnique is group to true.
sortBufferSizeThe size of sort buffer used when creating index, the unit is MB, zero means don't use sort buffer.
Exceptions
SequoiaDB.BaseException
System.Exception
DBLob SequoiaDB.DBCollection.CreateLob ( )
inline

Create a large object.

Returns
The newly created lob object
Exceptions
SequoiaDB.BaseException
System.Exception
DBLob SequoiaDB.DBCollection.CreateLob ( ObjectId  id)
inline

Create a large object with specified oid.

Parameters
idThe oid for the creating lob
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Delete ( BsonDocument  matcher)
inline

Delete the matching document of current collection.

Parameters
matcherThe matching condition, delete all the documents if null
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Delete ( BsonDocument  matcher,
BsonDocument  hint 
)
inline

Delete the matching document of current collection.

Parameters
matcherThe matching condition, delete all the documents if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.DetachCollection ( string  subClFullName)
inline

Detach the specified collection.

Parameters
subClFullNameThe name of the subcollection
Return values
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.DropIdIndex ( )
inline

Drop $id index in collection.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.DropIndex ( string  name)
inline

Remove the named index of current collection.

Parameters
nameThe index name
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Explain ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows,
int  flag,
BsonDocument  options 
)
inline

Find documents of current collection.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
flagThe query flag, default to be 0. Please see the definition of follow flags for more detail. Usage: e.g. set ( DBQuery.FLG_QUERY_FORCE_HINT | DBQuery.FLG_QUERY_WITH_RETURNDATA ) to param flag
DBQuery.FLG_QUERY_FORCE_HINT
DBQuery.FLG_QUERY_PARALLED
DBQuery.FLG_QUERY_WITH_RETURNDATA
[in]optionsThe rules of query explain, the options are as below:
Run     : Whether execute query explain or not, true for excuting query explain then get
          the data and time information; false for not excuting query explain but get the
          query explain information only. e.g. {Run:true}
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
long SequoiaDB.DBCollection.GetCount ( BsonDocument  matcher,
BsonDocument  hint 
)
inline

Get the count of matching documents in current collection.

Parameters
matcherThe matching rule, when condition is null, the return amount contains all the records.
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
Returns
The count of matching documents
Exceptions
SequoiaDB.BaseException
System.Exception
long SequoiaDB.DBCollection.GetCount ( BsonDocument  matcher)
inline

Get the count of matching documents in current collection.

Parameters
matcherThe matching rule, when condition is null, the return amount contains all the records.
Returns
The count of matching documents
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.GetIndex ( string  name)
inline

Get the named index of current collection.

Parameters
nameThe index name
Returns
A index, if not exist then return null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.GetIndexes ( )
inline

Get all the indexes of current collection.

Returns
A cursor of all indexes or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.GetQueryMeta ( BsonDocument  query,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows 
)
inline

Get the index blocks' or data blocks' infomations for concurrent query.

Parameters
querythe matching rule, return all the meta information if null
orderBythe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means not using any index to scan data(table scan). when hint is null, database automatically match the optimal index to scan data.
skipRowsThe rows to be skipped
returnRowsreturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
Returns
The DBCursor of matching infomations or null
Exceptions
SequoiaDB.BaseException
System.Exception
Deprecated:
this API only support in java
BsonValue SequoiaDB.DBCollection.Insert ( BsonDocument  record)
inline

Insert a document into current collection.

Parameters
insertorThe Bson document of insertor, can't be null
Returns
Return the value of field "_id" in "insertor". If "insertor" has no field "_id", API will add one and return the value which type is ObjectId, so we can get the return value by BsonValue::AsObjectId property.
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.ListLobs ( )
inline

List all of the lobs in current collection.

Return values
DBCursorof lobs
Exceptions
SequoiaDB.BaseException
System.Exception
DBLob SequoiaDB.DBCollection.OpenLob ( ObjectId  id)
inline

Open an existing lob with the speceifed oid.

Parameters
idThe oid of the existing lob
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Query ( )
inline

Find all documents of current collection.

Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Query ( DBQuery  query)
inline

Find documents of current collection with DBQuery.

Parameters
queryDBQuery with matching condition, selector, order rule, hint, SkipRowsCount and ReturnRowsCount
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Query ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint 
)
inline

Find documents of current collection.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Query ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows 
)
inline

Find documents of current collection.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.Query ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows,
int  flag 
)
inline

Find documents of current collection.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
flagThe query flag, default to be 0. Please see the definition of follow flags for more detail. Usage: e.g. set ( DBQuery.FLG_QUERY_FORCE_HINT | DBQuery.FLG_QUERY_WITH_RETURNDATA ) to param flag

DBQuery.FLG_QUERY_FORCE_HINT DBQuery.FLG_QUERY_PARALLED DBQuery.FLG_QUERY_WITH_RETURNDATA

Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.QueryAndRemove ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows,
int  flag 
)
inline

Find documents of current collection and remove.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
flagThe query flag, default to be 0. Please see the definition of follow flags for more detail. Usage: e.g. set ( DBQuery.FLG_QUERY_FORCE_HINT | DBQuery.FLG_QUERY_WITH_RETURNDATA ) to param flag
DBQuery.FLG_QUERY_FORCE_HINT
DBQuery.FLG_QUERY_PARALLED
DBQuery.FLG_QUERY_WITH_RETURNDATA
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.DBCollection.QueryAndUpdate ( BsonDocument  query,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
BsonDocument  update,
long  skipRows,
long  returnRows,
int  flag,
bool  returnNew 
)
inline

Find documents of current collection and update.

Parameters
queryThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
updateThe update rule, can't be null
flagThe query flag, default to be 0. Please see the definition of follow flags for more detail. Usage: e.g. set ( DBQuery.FLG_QUERY_FORCE_HINT | DBQuery.FLG_QUERY_WITH_RETURNDATA ) to param flag
DBQuery.FLG_QUERY_FORCE_HINT
DBQuery.FLG_QUERY_PARALLED
DBQuery.FLG_QUERY_WITH_RETURNDATA
returnNewWhen true, returns the updated document rather than the original
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBLob SequoiaDB.DBCollection.RemoveLob ( ObjectId  id)
inline

Remove an existing lob with the speceifed oid.

Parameters
idThe oid of the existing lob
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Split ( string  sourceGroupName,
string  destGroupName,
BsonDocument  splitCondition,
BsonDocument  splitEndCondition 
)
inline

Split the collection from one group into another group by range.

Parameters
sourceGroupNameThe source group
destGroupNameThe destination group
splitConditionThe split condition
splitEndConditionThe split end condition or null eg:If we create a collection with the option {ShardingKey:{"age":1},ShardingType:"Hash",Partition:2^10}, we can fill {age:30} as the splitCondition, and fill {age:60} as the splitEndCondition. when split, the targe group will get the records whose age's hash value are in [30,60). If splitEndCondition is null, they are in [30,max).
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Split ( string  sourceGroupName,
string  destGroupName,
double  percent 
)
inline

Split the collection from one group into another group by percent.

Parameters
sourceGroupNameThe source group
destGroupNameThe destination group
percentpercent The split percent, Range:(0.0, 100.0]
Exceptions
SequoiaDB.BaseException
System.Exception
long SequoiaDB.DBCollection.SplitAsync ( String  sourceGroupName,
String  destGroupName,
BsonDocument  splitCondition,
BsonDocument  splitEndCondition 
)
inline

Split the specified collection from source group to target group by range asynchronously.

Parameters
sourceGroupNamethe source group name
destGroupNamethe destination group name
splitConditionthe split condition
splitEndConditionthe split end condition or null eg:If we create a collection with the option {ShardingKey:{"age":1},ShardingType:"Hash",Partition:2^10}, we can fill {age:30} as the splitCondition, and fill {age:60} as the splitEndCondition. when split, the targe group will get the records whose age's hash values are in [30,60). If splitEndCondition is null, they are in [30,max).
Returns
return the task id, we can use the return id to manage the sharding which is run backgroup.
Exceptions
SequoiaDB.BaseException
System.Exception
See Also
listTask, cancelTask
long SequoiaDB.DBCollection.SplitAsync ( String  sourceGroupName,
String  destGroupName,
double  percent 
)
inline

Split the specified collection from source group to target group by percent asynchronously.

Parameters
sourceGroupNamethe source group name
destGroupNamethe destination group name
percentthe split percent, Range:(0,100]
Returns
return the task id, we can use the return id to manage the sharding which is run backgroup.
Exceptions
SequoiaDB.BaseException
System.Exception
See Also
listTask, cancelTask
void SequoiaDB.DBCollection.Truncate ( )
inline

Truncate the collection.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.DBCollection.Update ( DBQuery  query)
inline

Update the document of current collection.

Parameters
queryDBQuery with matching condition, updating rule and hint
Exceptions
SequoiaDB.BaseException
System.Exception
Note
It won't work to update the "ShardingKey" field, but the other fields take effect
void SequoiaDB.DBCollection.Update ( BsonDocument  matcher,
BsonDocument  modifier,
BsonDocument  hint 
)
inline

Update the document of current collection.

Parameters
matcherThe matching condition, update all the documents if null
modifierThe updating rule, can't be null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
Exceptions
SequoiaDB.BaseException
System.Exception
Note
It won't work to update the "ShardingKey" field, but the other fields take effect
void SequoiaDB.DBCollection.Upsert ( BsonDocument  matcher,
BsonDocument  modifier,
BsonDocument  hint 
)
inline

Update the document of current collection, insert if no matching.

Parameters
matcherThe matching condition, update all the documents if null(that's to say, we match all the documents)
modifierThe updating rule, can't be null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
Exceptions
SequoiaDB.BaseException
System.Exception
Note
It won't work to upsert the "ShardingKey" field, but the other fields take effect
void SequoiaDB.DBCollection.Upsert ( BsonDocument  matcher,
BsonDocument  modifier,
BsonDocument  hint,
BsonDocument  setOnInsert 
)
inline

Update the document of current collection, insert if no matching.

Parameters
matcherThe matching condition, update all the documents if null(that's to say, we match all the documents)
modifierThe updating rule, can't be null
hintSpecified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is null, database automatically match the optimal index to scan data.
setOnInsertThe setOnInsert assigns the specified values to the fileds when insert
Exceptions
SequoiaDB.BaseException
System.Exception
Note
It won't work to upsert the "ShardingKey" field, but the other fields take effect

Property Documentation

SequoiaDB.DBCollection.CollSpace
get

\ brief Return the Collection Space handle of current collection

Returns
CollectionSpace object
SequoiaDB.DBCollection.EnsureOID
getset

Get or set whether insert oid in records when bulk insert.

Returns
True for ensure, false for not
SequoiaDB.DBCollection.FullName
get

Return the full name of current collection.

Returns
The collection name
SequoiaDB.DBCollection.Name
get

Return the name of current collection.

Returns
The collection name

The documentation for this class was generated from the following file: