Class CollectionCreateOptions


  • public class CollectionCreateOptions
    extends Object
    • Constructor Detail

      • CollectionCreateOptions

        public CollectionCreateOptions()
    • Method Detail

      • getName

        protected String getName()
      • getKeyOptions

        public KeyOptions getKeyOptions()
      • keyOptions

        public CollectionCreateOptions keyOptions​(Boolean allowUserKeys,
                                                  KeyType type,
                                                  Integer increment,
                                                  Integer offset)
        Parameters:
        allowUserKeys - if set to true, then it is allowed to supply own key values in the _key attribute of a document. If set to false, then the key generator will solely be responsible for generating keys and supplying own key values in the _key attribute of documents is considered an error.
        type - specifies the type of the key generator. The currently available generators are traditional and autoincrement.
        increment - increment value for autoincrement key generator. Not used for other key generator types.
        offset - Initial offset value for autoincrement key generator. Not used for other key generator types.
        Returns:
        options
      • getShardKeys

        public String[] getShardKeys()
      • shardKeys

        public CollectionCreateOptions shardKeys​(String... shardKeys)
        Parameters:
        shardKeys - (The default is [ "_key" ]): in a cluster, this attribute determines which document attributes are used to determine the target shard for documents. Documents are sent to shards based on the values of their shard key attributes. The values of all shard key attributes in a document are hashed, and the hash value is used to determine the target shard. Note: Values of shard key attributes cannot be changed once set. This option is meaningless in a single server setup.
        Returns:
        options
      • getIsSpot

        public Boolean getIsSpot()
      • isSpot

        public CollectionCreateOptions isSpot​(Boolean isSpot)
        Parameters:
        isSpot - If true then all access to the collection is done on the spot region of the fabric the collection is in. (default: false)
        Returns:
        options
      • getLocal

        public Boolean getLocal()
      • hasStream

        public Boolean hasStream()
      • isSystem

        public final Boolean isSystem()
        Checks whether the collection is system
        Returns:
        true or false
      • isEnableShards

        public Boolean isEnableShards()
        Checks whether the shards are enabled.
        Returns:
        true of false
      • isWaitForSync

        public Boolean isWaitForSync()
        Checks whether the waitForSync is enabled.
        Returns:
        true of false