BSONObjectID
public struct BSONObjectID : Equatable, Hashable, CustomStringConvertible
A struct to represent the BSON ObjectID type.
-
This
BSONObjectID
‘s data represented as aString
.Declaration
Swift
public var hex: String { get }
-
Declaration
Swift
public var description: String { get }
-
The timestamp portion of this
BSONObjectID
represented as aDate
.Declaration
Swift
public var timestamp: Date { get }
-
Initializes a new
BSONObjectID
.Declaration
Swift
public init()
-
Initializes an
BSONObjectID
from the provided hexString
.Throws
BSONError.InvalidArgumentError
if string passed is not a valid BSONObjectID
Declaration
Swift
public init(_ hex: String) throws
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws