ObjectId
public struct ObjectId : BSONValue, Equatable, CustomStringConvertible, Codable
A struct to represent the BSON ObjectId type.
-
Declaration
Swift
public var bsonType: BSONType { get }
-
This
ObjectId
‘s data represented as aString
.Declaration
Swift
public var hex: String { get }
-
The timestamp used to create this
ObjectId
Declaration
Swift
public var timestamp: UInt32 { get }
-
Declaration
Swift
public var description: String { get }
-
Initializes a new
ObjectId
.Declaration
Swift
public init()
-
Initializes an
ObjectId
from the provided hexString
. Returnsnil
if the string is not a valid ObjectId.Declaration
Swift
public init?(_ hex: String)
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to: Encoder) throws
-
Declaration
Swift
public func encode(to storage: DocumentStorage, forKey key: String) throws
-
Declaration
Swift
public static func from(iterator iter: DocumentIterator) throws -> ObjectId
-
Declaration
Swift
public static func == (lhs: ObjectId, rhs: ObjectId) -> Bool