public class CollectionSpace extends Object
限定符和类型 | 方法和说明 |
---|---|
void |
alterCollectionSpace(BSONObject options)
Alter the current collection space.
|
DBCollection |
createCollection(String collectionName)
Create the named collection in current collection space.
|
DBCollection |
createCollection(String collectionName,
BSONObject options)
Create collection by options.
|
void |
disableCapped()
Alter the current collection space to disable capped
|
void |
dropCollection(String collectionName)
Remove the named collection of current collection space.
|
void |
enableCapped()
Alter the current collection space to enable capped
|
DBCollection |
getCollection(String collectionName)
Get the named collection.
|
List<String> |
getCollectionNames()
Get all the collection names of current collection space.
|
String |
getName()
Return the name of current collection space.
|
Sequoiadb |
getSequoiadb()
Get the Sequoiadb instance of current collection space belongs to.
|
boolean |
isCollectionExist(String collectionName)
Verify the existence of collection in current collection space.
|
void |
removeDomain()
Alter the current collection space to remove domain
|
void |
renameCollection(String oldName,
String newName) |
void |
setAttributes(BSONObject options)
Alter the current collection space to set attributes.
|
void |
setDomain(BSONObject options)
Alter the current collection space to set domain
|
public void alterCollectionSpace(BSONObject options) throws BaseException
options
- The options of the collection space:
BaseException
- If error happens.public DBCollection createCollection(String collectionName) throws BaseException
collectionName
- The collection nameBaseException
- If error happens.public DBCollection createCollection(String collectionName, BSONObject options)
collectionName
- The collection nameoptions
- The options for creating collection, including
"ShardingKey", "ReplSize", "IsMainCL" and "Compressed" informations,
no options, if nullBaseException
- Tf error happens.public void disableCapped() throws BaseException
BaseException
- If error happens.public void dropCollection(String collectionName) throws BaseException
collectionName
- The collection nameBaseException
- If error happens.public void enableCapped() throws BaseException
BaseException
- If error happens.public DBCollection getCollection(String collectionName) throws BaseException
collectionName
- The collection nameBaseException
- If error happens.public List<String> getCollectionNames() throws BaseException
BaseException
- If error happens.public String getName()
public Sequoiadb getSequoiadb()
public boolean isCollectionExist(String collectionName) throws BaseException
collectionName
- The collection nameBaseException
- If error happens.public void removeDomain() throws BaseException
BaseException
- If error happens.public void renameCollection(String oldName, String newName) throws BaseException
oldName
- The old collection namenewName
- The new collection nameBaseException
- If error happens.public void setAttributes(BSONObject options) throws BaseException
options
- The options of the collection space:
BaseException
- If error happens.public void setDomain(BSONObject options) throws BaseException
options
- The options of the collection space:
BaseException
- If error happens.Copyright © 2018. All rights reserved.