From 1b45ad3b5287f065bd4635ec50221ab3250dd5c8 Mon Sep 17 00:00:00 2001 From: Patrick Freed Date: Tue, 2 Jun 2020 14:48:45 -0400 Subject: [PATCH] document allowDiskUse --- Sources/MongoSwift/Operations/FindOperation.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/MongoSwift/Operations/FindOperation.swift b/Sources/MongoSwift/Operations/FindOperation.swift index b1880841c..5aca0f37c 100644 --- a/Sources/MongoSwift/Operations/FindOperation.swift +++ b/Sources/MongoSwift/Operations/FindOperation.swift @@ -33,7 +33,12 @@ public enum MongoCursorType { /// Options to use when executing a `find` command on a `MongoCollection`. public struct FindOptions: Codable { /// Enables the server to write to temporary files. When set to true, the find operation - /// can write data to the _tmp subdirectory in the dbPath directory. + /// can write data to the _tmp subdirectory in the dbPath directory. This helps prevent + /// out-of-memory failures server side when working with large result sets. + /// + /// - Note: + /// This option is only supported in MongoDB 4.4+. Specifying it against earlier versions of the server + /// will result in an error. public var allowDiskUse: Bool? /// Get partial results from a mongos if some shards are down (instead of throwing an error).