ObjectId

public struct ObjectId : BSONValue, Equatable, CustomStringConvertible, Codable

A struct to represent the BSON ObjectId type.

  • Declaration

    Swift

    public var bsonType: BSONType { get }
  • hex

    This ObjectId‘s data represented as a String.

    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 hex String. Returns nil 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