WebcomKey

public struct WebcomKey : Codable, Hashable, Comparable, ExpressibleByStringLiteral, CustomStringConvertible

A value representing the key of a database node.

The order of the keys is defined as follows:

  • Keys that are parsable as integers are ordered before all other keys.
  • Integer keys (with no leading 0) are ordered following the natural order on integers.
  • Integer keys representing the same number are ordered from the one with the least leading 0 to the one with the most leading 0.
  • All other keys are ordered in lexicographic order.

Example:

0 < 1 < 01 < 001 < 7 < 09 < 72 < 521 < 1000 < aa < b < bb

Stored Properties

  • The string representing this instance.

    Declaration

    Swift

    public let value: String

Initializers

  • Creates a new instance.

    Declaration

    Swift

    public init(_ value: String)

    Parameters

    value

    The string representing the key.

  • Creates a new instance.

    When the value is nil, this initializer fails to create an instance and it returns nil.

    Declaration

    Swift

    public init?(_ value: String?)

    Parameters

    value

    The string representing the key.

  • Declaration

    Swift

    public init(stringLiteral value: StringLiteralType)
  • Declaration

    Swift

    public init(from decoder: Decoder) throws

Encodable Protocol

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws

Comparable Protocol

  • Declaration

    Swift

    public static func < (left: WebcomKey, right: WebcomKey) -> Bool

API

  • The date stored in this key, when it is timestamp-based.

    A node created with the DatasyncNode.createChild() or the DatasyncNode.push(_:queue:then:) method has a timestamp-based key, with a timestamp corresponding to its creation date.

    This property is nil when this key is not timestamp-based.

    Since

    2.2.0

    Declaration

    Swift

    public var date: Date? { get }

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }