FindOptions

extension FindOptions
  • Limits the fields to return for all matching documents.

    Declaration

    Swift

    public var projection: Document? { get set }
  • The order in which to return matching documents.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `sorting`")
    public var sort: Document? { get set }
  • The order in which to return matching documents.

    Declaration

    Swift

    public var sorting: [Document] { get set }
  • Options to use when executing a find command on a MongoCollection.

    Declaration

    Swift

    @available(*, deprecated, message: "Use init(limit:projection:sorting:﹚")
    public convenience init(_ limit: Int?, _ projection: Document?, _ sort: Document?)

    Parameters

    limit

    The maximum number of documents to return. Specifying 0 will return all documents.

    projected

    Limits the fields to return for all matching documents.

    sort

    The order in which to return matching documents.

  • Options to use when executing a find command on a MongoCollection.

    Declaration

    Swift

    public convenience init(_ limit: Int = 0, _ projection: Document? = nil, _ sorting: [Document] = [])

    Parameters

    limit

    The maximum number of documents to return. Specifying 0 will return all documents.

    projected

    Limits the fields to return for all matching documents.

    sorting

    The order in which to return matching documents.

  • Options to use when executing a find command on a MongoCollection.

    Declaration

    Swift

    @available(*, deprecated, message: "Use init(limit:projection:sorting:﹚")
    public convenience init(limit: Int?, projection: Document?, sort: Document?)

    Parameters

    limit

    The maximum number of documents to return. Specifying 0 will return all documents.

    projected

    Limits the fields to return for all matching documents.

    sort

    The order in which to return matching documents.