Instance Methodmongokitten 7.9.5MongoKittenCore
include(_:)
Includes the field in the projection
Projection.swift:107mutating func include(_ field: FieldPath)
Example:
// explicitly include the field "name"
var projection: Projection = [
"name": .included,
]
// also include the "birthDate" field
projection.include("birthDate")
Other members in extension
Types
enum ProjectionExpression
An expression that can be specified to either include or exclude a field (or some custom value)
Type members
init(dictionaryLiteral: (FieldPath, ProjectionExpression)...
) init(document: Document
) static func allExcluding(Set<String>
) -> Projection static func subset(Set<String>, suppressingId: Bool
) -> Projection
Instance members
var document: Document
var minimalVersion: WireVersion?
func addLiteral(Primitive, at: FieldPath
) func encode(to: Encoder
) throws func exclude(FieldPath
) Excludes the field from the projection
func exclude(Set<FieldPath>
) Excludes the field from the projection
func include(Set<FieldPath>
) Includes the field in the projection
func moveRoot(to: FieldPath
) Makes the entire document available at a new location.
func projectElements(inArray: FieldPath, from: Int, count: Int
) func projectFirst(Int, forArray: FieldPath
) func projectFirstElement(forArray: FieldPath
) func projectLast(Int, forArray: FieldPath
) func rename(FieldPath, to: FieldPath
) Renames a field.