Class CountOptions

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

    public class CountOptions
    extends 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​(Document hint)
        Defines the index hint value
        Parameters:
        hint - the hint
        Returns:
        this
      • readConcern

        public 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 ReadPreference readPreference()
        Returns the readPreference
        Specified by:
        readPreference in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Returns:
        the readPreference
      • readConcern

        public CountOptions readConcern​(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​(ReadPreference readPreference)
        Sets the readPreference
        Specified by:
        readPreference in interface dev.morphia.internal.ReadConfigurable<CountOptions>
        Parameters:
        readPreference - the readPreference
        Returns:
        this