Class CountOptions

  • java.lang.Object
    • com.mongodb.client.model.CountOptions
      • dev.morphia.query.CountOptions
  • All Implemented Interfaces:
    dev.morphia.internal.SessionConfigurable<CountOptions>

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

      • CountOptions

        public CountOptions()
    • Method Detail

      • clientSession

        public CountOptions clientSession​(com.mongodb.client.ClientSession clientSession)
        Description copied from interface: dev.morphia.internal.SessionConfigurable
        Set the client session to use for the insert.
        Specified by:
        clientSession in interface dev.morphia.internal.SessionConfigurable<CountOptions>
        Parameters:
        clientSession - the client session
        Returns:
        this
      • clientSession

        public com.mongodb.client.ClientSession clientSession()
        Description copied from interface: dev.morphia.internal.SessionConfigurable
        The client session to use for the insertion.
        Specified by:
        clientSession in interface dev.morphia.internal.SessionConfigurable<CountOptions>
        Returns:
        the client session
      • 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​(org.bson.conversions.Bson hint)
        Overrides:
        hint in class com.mongodb.client.model.CountOptions
      • limit

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

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

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

        public long getMaxTime​(TimeUnit timeUnit)
        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​(com.mongodb.client.model.Collation collation)
        Overrides:
        collation in class com.mongodb.client.model.CountOptions
      • readConcern

        public com.mongodb.ReadConcern readConcern()
        Returns the readConcern
        Returns:
        the readConcern
        Since server release
        3.2
      • readConcern

        public CountOptions readConcern​(com.mongodb.ReadConcern readConcern)
        Sets the readConcern
        Parameters:
        readConcern - the readConcern
        Returns:
        this
        Since server release
        3.2
      • readPreference

        public com.mongodb.ReadPreference readPreference()
        Returns the readPreference
        Returns:
        the readPreference
      • readPreference

        public CountOptions readPreference​(com.mongodb.ReadPreference readPreference)
        Sets the readPreference
        Parameters:
        readPreference - the readPreference
        Returns:
        this