Class CreateCollectionParam.Builder

    • Method Detail

      • withCollectionName

        public CreateCollectionParam.Builder withCollectionName​(@NonNull
                                                                @NonNull java.lang.String collectionName)
        Sets the collection name. Collection name cannot be empty or null.
        Parameters:
        collectionName - collection name
        Returns:
        Builder
      • withDatabaseName

        public CreateCollectionParam.Builder withDatabaseName​(java.lang.String databaseName)
        Sets the database name. database name can be nil.
        Parameters:
        databaseName - database name
        Returns:
        Builder
      • withShardsNum

        public CreateCollectionParam.Builder withShardsNum​(int shardsNum)
        Sets the shards number. The number must be greater or equal to zero. The default value is 0, which means letting the server decide the value. The server set this value to 1 if user didn't specify it.
        Parameters:
        shardsNum - shards number to distribute insert data into multiple data nodes and query nodes.
        Returns:
        Builder
      • withEnableDynamicField

        @Deprecated
        public CreateCollectionParam.Builder withEnableDynamicField​(boolean enableDynamicField)
        Deprecated.
        Sets the collection if enableDynamicField.
        Parameters:
        enableDynamicField - enableDynamicField of the collection
        Returns:
        Builder
      • withDescription

        public CreateCollectionParam.Builder withDescription​(@NonNull
                                                             @NonNull java.lang.String description)
        Sets the collection description. The description can be empty. The default is "".
        Parameters:
        description - description of the collection
        Returns:
        Builder
      • withPartitionsNum

        public CreateCollectionParam.Builder withPartitionsNum​(int partitionsNum)
        Sets the partitions number if there is partition key field. The number must be greater than zero. The default value is 64(defined in server side). The upper limit is 4096(defined in server side). Not allow to set this value if none of field is partition key. Only one partition key field is allowed in a collection.
        Parameters:
        partitionsNum - partitions number
        Returns:
        Builder