ObjectId
public struct ObjectId : BSONValue, Equatable, CustomStringConvertible, Codable
extension ObjectId: Hashable
A struct to represent the BSON ObjectId type.
-
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 static func == (lhs: ObjectId, rhs: ObjectId) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)