FindOneAndModifyOptions

  • 限制要为所有匹配文档返回的字段。

    声明

    迅速

    public var projection: Document? { get set }
  • 返回匹配文档的顺序。

    声明

    迅速

    @available(*, deprecated, message: "Use `sorting`")
    public var sort: Document? { get set }
  • 返回匹配文档的顺序,由 SortDescriptor

    声明

    迅速

    public var sorting: [Document] { get set }
  • MongoCollection执行findOneAndUpdatefindOneAndReplacefindOneAndDelete命令时使用的选项

    声明

    迅速

    @available(*, deprecated, message: "Use init(projection:sorting:upsert:shouldReturnNewDocument:﹚")
    public convenience init(_ projection: Document?,
                            _ sort: Document?,
                            _ upsert: Bool=false,
                            _ shouldReturnNewDocument: Bool=false)

    参数

    projection

    限制要为所有匹配文档返回的字段。

    sort

    返回匹配文档的顺序。

    upsert

    是否执行更新或插入,默认为 false(仅适用于 findOneAndReplace 和 findOneAndUpdate)

    shouldReturnNewDocument

    如果为 true,则返回新文档,否则返回旧文档(默认)(仅适用于 findOneAndReplace 和 findOneAndUpdate)

  • MongoCollection执行findOneAndUpdatefindOneAndReplacefindOneAndDelete命令时使用的选项

    声明

    迅速

    public convenience init(_ projection: Document?,
                            _ sorting: [Document] = [],
                            _ upsert: Bool=false,
                            _ shouldReturnNewDocument: Bool=false)

    参数

    projection

    限制要为所有匹配文档返回的字段。

    sorting

    返回匹配文档的顺序。

    upsert

    是否执行更新或插入,默认为 false(仅适用于 findOneAndReplace 和 findOneAndUpdate)

    shouldReturnNewDocument

    如果为 true,则返回新文档,否则返回旧文档(默认)(仅适用于 findOneAndReplace 和 findOneAndUpdate)

  • MongoCollection执行findOneAndUpdatefindOneAndReplacefindOneAndDelete命令时使用的选项

    声明

    迅速

    @available(*, deprecated, message: "Use init(projection:sorting:upsert:shouldReturnNewDocument:﹚")
    public convenience init(projection: Document?,
                            sort: Document?,
                            upsert: Bool=false,
                            shouldReturnNewDocument: Bool=false)

    参数

    projection

    限制要为所有匹配文档返回的字段。

    sort

    返回匹配文档的顺序。

    upsert

    是否执行更新或插入,默认为 false(仅适用于 findOneAndReplace 和 findOneAndUpdate)

    shouldReturnNewDocument

    如果为 true,则返回新文档,否则返回旧文档(默认)(仅适用于 findOneAndReplace 和 findOneAndUpdate)