Class CountOptions

  • All Implemented Interfaces:
    dev.morphia.internal.CollectionConfigurable<CountOptions>, dev.morphia.internal.CollectionConfiguration, dev.morphia.internal.ReadConfigurable<CountOptions>

    public class CountOptions
    extends com.mongodb.client.model.CountOptions
    implements dev.morphia.internal.CollectionConfigurable<CountOptions>, dev.morphia.internal.ReadConfigurable<CountOptions>
    The options for a count operation.
    Since:
    1.3
    • Constructor Detail

      • CountOptions

        public CountOptions()
    • Method Detail

      • collection

        public CountOptions collection​(String collection)
        Description copied from interface: dev.morphia.internal.CollectionConfigurable
        Sets the alternate collection to use for the operation.
        Specified by:
        collection in interface dev.morphia.internal.CollectionConfigurable<CountOptions>
        Parameters:
        collection - the name of the collection to use
        Returns:
        this
      • collection

        public String collection()
        Description copied from interface: dev.morphia.internal.CollectionConfigurable
        Returns the alternate collection to use for the operation. Might return null.
        Specified by:
        collection in interface dev.morphia.internal.CollectionConfigurable<CountOptions>
        Returns:
        the collection name or null
      • hint

        public CountOptions hint​(String hint)
        Defines the index hint value
        Parameters:
        hint - the hint
        Returns:
        this
      • hint

        public CountOptions hint​(org.bson.Document hint)
        Defines the index hint value
        Parameters:
        hint - the hint
        Returns:
        this
      • hint

        public CountOptions hint​(@Nullable
                                 org.bson.conversions.Bson hint)
        Overrides:
        hint in class com.mongodb.client.model.CountOptions
      • hintString

        public CountOptions hintString​(@Nullable
                                       String hint)
        Overrides:
        hintString in class com.mongodb.client.model.CountOptions
      • limit

        public CountOptions limit​(int limit)
        Overrides:
        limit in class com.mongodb.client.model.CountOptions
      • skip

        public CountOptions skip​(int skip)
        Overrides:
        skip in class com.mongodb.client.model.CountOptions
      • getMaxTime

        @Deprecated(forRemoval=true,
                    since="2.3")
        public long getMaxTime​(TimeUnit timeUnit)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        getMaxTime in class com.mongodb.client.model.CountOptions
      • maxTime

        public CountOptions maxTime​(long maxTime,
                                    TimeUnit timeUnit)
        Overrides:
        maxTime in class com.mongodb.client.model.CountOptions
      • collation

        public CountOptions collation​(@Nullable
                                      com.mongodb.client.model.Collation collation)
        Overrides:
        collation in class com.mongodb.client.model.CountOptions
      • comment

        public CountOptions comment​(String comment)
        Overrides:
        comment in class com.mongodb.client.model.CountOptions
        Returns:
        this
        Since:
        2.3
      • comment

        public CountOptions comment​(org.bson.BsonValue comment)
        Overrides:
        comment in class com.mongodb.client.model.CountOptions
        Returns:
        this
        Since:
        2.3
      • readConcern

        public com.mongodb.ReadConcern readConcern()
        Returns the readConcern
        Specified by:
        readConcern in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Returns:
        the readConcern
        Since server release
        3.2
      • readPreference

        public com.mongodb.ReadPreference readPreference()
        Returns the readPreference
        Specified by:
        readPreference in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Returns:
        the readPreference
      • readConcern

        public CountOptions readConcern​(com.mongodb.ReadConcern readConcern)
        Sets the readConcern
        Specified by:
        readConcern in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Parameters:
        readConcern - the readConcern
        Returns:
        this
        Since server release
        3.2
      • readPreference

        public CountOptions readPreference​(com.mongodb.ReadPreference readPreference)
        Sets the readPreference
        Specified by:
        readPreference in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Parameters:
        readPreference - the readPreference
        Returns:
        this