BSONCodeWithScope
public struct BSONCodeWithScope : BSONValue, Equatable, Codable, Hashable
A struct to represent BSON CodeWithScope.
-
A string containing Javascript code.
Declaration
Swift
public let code: String
-
An optional scope
BSONDocument
containing a mapping of identifiers to values, representing the context in whichcode
should be evaluated.Declaration
Swift
public let scope: BSONDocument
-
Initializes a
BSONCodeWithScope
with an optional scope value.Declaration
Swift
public init(code: String, scope: BSONDocument)
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to: Encoder) throws