com.holonplatform.datastore.mongo.core.expression

## Interface BsonQueryDefinition

- All Superinterfaces:
    com.holonplatform.core.Expression

      public interface BsonQueryDefinition
      extends com.holonplatform.core.Expression

  MongoDB query definition expression.
  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `BsonQueryDefinition.Builder` Builder

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `com.holonplatform.core.Expression.ExpressionResolverFunction<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression>, com.holonplatform.core.Expression.InvalidExpressionException`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BsonQueryDefinition.Builder` | `builder()` Get a `BsonQueryDefinition` builder.
    `Optional<Integer>` | `getBatchSize()` Get the number of documents to return per batch.
    `Optional<com.mongodb.client.model.Collation>` | `getCollation()` Get the `Collation` to use.
    `String` | `getCollectionName()` Get the collection name to query.
    `Optional<String>` | `getComment()` Get the query comment.
    `Optional<com.mongodb.CursorType>` | `getCursorType()` Get the cursor type to use.
    `Optional<BsonFilterExpression>` | `getFilter()` Get the query filters.
    `Optional<org.bson.conversions.Bson>` | `getGroup()` Get the group id for aggregation type query.
    `Optional<BsonFilterExpression>` | `getGroupFilter()` Get the filter to apply to the group stage in an aggregation type query.
    `Optional<org.bson.conversions.Bson>` | `getHint()` Get the hint for which index to use.
    `Optional<Integer>` | `getLimit()` Get the query results limit.
    `Optional<org.bson.conversions.Bson>` | `getMax()` Get the exclusive upper bound for a specific index.
    `Optional<org.bson.conversions.Bson>` | `getMin()` Get the minimum inclusive lower bound for a specific index.
    `Optional<Integer>` | `getOffset()` Get the number of query results to skip.
    `Optional<org.bson.conversions.Bson>` | `getSort()` Get the query sorts.
    `Optional<Long>` | `getTimeout()` Get the query execution timeout, using the time unit returned by `getTimeoutUnit()`.
    `TimeUnit` | `getTimeoutUnit()` Get the query execution timeout unit.
    `boolean` | `isDistinct()` Get whether the query is configured to return distinct results.
    `boolean` | `isPartial()` Whether to get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
    `boolean` | `isReturnKey()` Get whether the find operation will return only the index keys in the resulting documents.
    `boolean` | `isShowRecordId()` Whether to add a `$recordId` field to the returned documents.

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### getCollectionName

          String getCollectionName()

      Get the collection name to query.
      Returns:
        Query collection name

    - #### isDistinct

          boolean isDistinct()

      Get whether the query is configured to return distinct results.
      Returns:
        Whether the query is configured to return distinct results

    - #### getFilter

          Optional<BsonFilterExpression> getFilter()

      Get the query filters.
      Returns:
        Optional filter

    - #### getSort

          Optional<org.bson.conversions.Bson> getSort()

      Get the query sorts.
      Returns:
        Optional sort

    - #### getGroup

          Optional<org.bson.conversions.Bson> getGroup()

      Get the group id for aggregation type query.
      Returns:
        Optional group id

    - #### getGroupFilter

          Optional<BsonFilterExpression> getGroupFilter()

      Get the filter to apply to the group stage in an aggregation type query.
      Returns:
        Optional filter to apply to the group stage in an aggregation type query

    - #### getLimit

          Optional<Integer> getLimit()

      Get the query results limit.
      Returns:
        Optional query results limit

    - #### getOffset

          Optional<Integer> getOffset()

      Get the number of query results to skip.
      Returns:
        Optional query offset

    - #### getTimeout

          Optional<Long> getTimeout()

      Get the query execution timeout, using the time unit returned by `getTimeoutUnit()`.
      Returns:
        Optional query execution timeout

    - #### getTimeoutUnit

          TimeUnit getTimeoutUnit()

      Get the query execution timeout unit.
      Returns:
        The query execution timeout unit

    - #### getCursorType

          Optional<com.mongodb.CursorType> getCursorType()

      Get the cursor type to use.
      Returns:
        Optional cursor type

    - #### isPartial

          boolean isPartial()

      Whether to get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
      Returns:
        `true` to get partial results from a sharded cluster if one or more shards are unreachable

    - #### getBatchSize

          Optional<Integer> getBatchSize()

      Get the number of documents to return per batch.
      Returns:
        Optional batch size

    - #### getCollation

          Optional<com.mongodb.client.model.Collation> getCollation()

      Get the `Collation` to use.
      Returns:
        Optional collation

    - #### getComment

          Optional<String> getComment()

      Get the query comment.
      Returns:
        Optional query comment

    - #### getHint

          Optional<org.bson.conversions.Bson> getHint()

      Get the hint for which index to use.
      Returns:
        Optional index hint

    - #### getMax

          Optional<org.bson.conversions.Bson> getMax()

      Get the exclusive upper bound for a specific index.
      Returns:
        Optional max index bound

    - #### getMin

          Optional<org.bson.conversions.Bson> getMin()

      Get the minimum inclusive lower bound for a specific index.
      Returns:
        Optional min index bound

    - #### isReturnKey

          boolean isReturnKey()

      Get whether the find operation will return only the index keys in the resulting documents.
      Returns:
        Whether to return only the index keys

    - #### isShowRecordId

          boolean isShowRecordId()

      Whether to add a `$recordId` field to the returned documents.
      Returns:
        `true` to add a `$recordId` field to the returned documents

    - #### builder

          static BsonQueryDefinition.Builder builder()

      Get a `BsonQueryDefinition` builder.
      Returns:
        A new `BsonQueryDefinition` builder

Copyright © 2019 The Holon Platform. All rights reserved.