diff --git a/Package.resolved b/Package.resolved index a1b8c78..9183d98 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "ebb16d1d1fcda74fd2dc0e0602e51cefaf7e287a565c2fb97f3924259fec5629", + "originHash" : "f3f9fc391509642da9593d2b621fe1a85a1b66c4e7197e28b38bf613cc7baabf", "pins" : [ { "identity" : "swift-atomics", @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "1b33db2dea6a64d5b619b9e888175133c6d7f410", - "version" : "2.73.0" + "revision" : "f7dc3f527576c398709b017584392fb58592e7f5", + "version" : "2.75.0" } }, { @@ -51,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "a9fa5efd86e7ce2e5c1b6de113262e58035ca251", - "version" : "2.27.1" + "revision" : "d7ceaf0e4d8001cd35cdc12e42cdd281e9e564e8", + "version" : "2.28.0" } }, { diff --git a/Sources/MongoBuiltins/Expressions/Mongo.ExpressionEncoder.swift b/Sources/MongoBuiltins/Expressions/Mongo.ExpressionEncoder.swift index d9d60ef..7fb5652 100644 --- a/Sources/MongoBuiltins/Expressions/Mongo.ExpressionEncoder.swift +++ b/Sources/MongoBuiltins/Expressions/Mongo.ExpressionEncoder.swift @@ -150,8 +150,26 @@ extension Mongo.ExpressionEncoder enum Cond:String, Sendable { case cond = "$cond" + + @frozen public + enum Clause:String, Sendable + { + case `if` + case then + case `else` + } + } + + @inlinable public + subscript(key:Cond, yield:(inout Mongo.SetEncoder) -> ()) -> Void + { + mutating get + { + yield(&self.bson[with: key][as: Mongo.SetEncoder.self]) + } } + @available(*, deprecated, message: "Use subscript(_:_:) instead.") @inlinable public subscript(key:Cond) -> (if:Predicate?, then:Then?, else:Else?) where Predicate:BSONEncodable,