name
setDomain-Modify the domain of the collection space.
grammar
db.collectionspace.setDomain(<options>)
category
Collection Space
description
Modify the domain of the collection space.
parameter
-
options
( Object , required )The
options
properties of the collection space can be modified through parameters:-
Domain
( String ): The domain to which it belongs.- The data in the collection space must be distributed on the group of the newly designated domain
format:
Domain : <domain>
-
return value
Success: None.
Failure: Throw an exception.
error
When an exception is thrown, you can () getLastError get an error code , or through ) getLastErrMsg ( get an error message. You can refer to the common error handling guide to learn more.
version
v2.10 and above.
Example
-
Create a collection space, and then specify a domain for the collection space
db.createCS( 'sample' ) db.sample.setDomain( { Domain : 'domain' } )
Click on Jushan Database Documentation Center for more information