Obj

public struct Obj: Expr, AsJson, CustomStringConvertible

Represents a hash map in FaunaDB where the key is always a String and the value can be a primitive value or an expression to be evaluated.

You can use the operator => as a syntax sugar while building new objects.

Reference

For example:

// Using a primitive value
Obj("name" => "John")

// Using a call to `Time` function
Obj("created_at" => Time("now"))
  • Declaration

    Swift

    public var description: String
  • Converts a native dictionary to an Obj instance.

    Declaration

    Swift

    public init(wrap: [String: Expr?])
  • Initializes a new Obj instance with the key value tuples provided. You can use the operator => as a syntax sugar while building new objects.

    Declaration

    Swift

    public init(_ pairs: (String, Expr?)...)