Projection

data class Projection(val include: List<QueryField> = emptyList(), val exclude: List<QueryField> = emptyList())

Data class representing field projection settings for queries.

Projection controls which fields are included in or excluded from query results. Use include to select nodes and their descendants, or exclude to omit them. If both lists are empty, all fields are included. Combining include and exclude follows backend restrictions.

MongoDB single/list/paged queries retain the native _id field by default even when include omits it. It is returned as aggregateId for snapshots and id for event streams. Explicitly exclude that logical field to suppress it; MongoDB permits this ID exclusion alongside include. Elasticsearch does not add an unrequested ID. Cursor queries remove fields fetched only for sorting, including an unrequested ID.

Constructors

Link copied to clipboard
constructor(include: List<QueryField> = emptyList(), exclude: List<QueryField> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Nodes to omit, including the logical ID when it should not be returned.

Link copied to clipboard

Nodes to return, subject to the MongoDB ID exception above.

Functions

Link copied to clipboard

Checks if this projection has no field filtering (includes all fields).