p

faunadb

values

package values

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class ArrayV(elems: Vector[Value]) extends Value with Product with Serializable

    An Array.

  2. sealed abstract class BooleanV extends ScalarValue

    A Boolean value.

  3. case class BytesV(bytes: Array[Byte]) extends ScalarValue with Product with Serializable
  4. trait Codec[T] extends Decoder[T] with Encoder[T]
  5. class CodecMacro extends AnyRef
  6. case class DateV(localDate: LocalDate) extends ScalarValue with Product with Serializable

    A Date value.

  7. trait Decoder[T] extends AnyRef
  8. case class DoubleV(value: Double) extends ScalarValue with Product with Serializable

    A Double value.

  9. trait Encoder[T] extends AnyRef
  10. sealed abstract class Field[T] extends AnyRef
  11. case class FieldError(error: String, path: FieldPath) extends Product with Serializable
  12. sealed abstract class FieldPath extends AnyRef
  13. case class FieldPathField(field: String) extends FieldPath with Product with Serializable
  14. case class FieldPathIdx(idx: Int) extends FieldPath with Product with Serializable
  15. case class FieldPathNode(l: FieldPath, r: FieldPath) extends FieldPath with Product with Serializable
  16. case class LongV(value: Long) extends ScalarValue with Product with Serializable

    A Long value.

  17. sealed trait NullV extends Value

    The Null value.

  18. case class ObjectV(fields: Map[String, Value]) extends Value with Product with Serializable

    An Object value.

  19. case class QueryV(lambda: ObjectV) extends Value with Product with Serializable
  20. trait RecordCodec[T] extends Codec[T]
  21. case class RefV(id: String, collection: Option[RefV] = None, database: Option[RefV] = None) extends ScalarValue with Product with Serializable

    A Ref.

  22. sealed abstract class Result[+T] extends AnyRef
  23. sealed abstract class ScalarValue extends Value

    Base trait for all scalar values.

    Base trait for all scalar values.

    Arrays, objects, and null are not considered scalar values.

  24. case class SetRefV(parameters: Value) extends ScalarValue with Product with Serializable

    A Set Ref.

  25. case class StringV(value: String) extends ScalarValue with Product with Serializable

    A String value.

  26. case class TimeV(toInstant: Instant) extends ScalarValue with Product with Serializable

    A Timestamp value.

  27. trait UnionCodec[T] extends Codec[T]
  28. final case class VFail extends Result[Nothing] with Product with Serializable
  29. final case class VSuccess[+T] extends Result[T] with Product with Serializable
  30. sealed trait Value extends AnyRef

    A FaunaDB value.

    A FaunaDB value.

    Reference: FaunaDB Values

    Overview

    Value is an algebraic data type that represents the value of possible FaunaDB query responses. While it is possible to extract data out of a Value object using pattern matching, the faunadb.values.Field lets you create more complex and reusable data extractors.

    // Simple, adhoc extraction:
    value("data", "name").to[String].get
    
    // Using a reusable Field:
    val NameField = Field("data", "name").to[String]
    value(NameField).get

    Extraction can be composed:

    val refAndNameAndAge = for {
      ref <- value("ref").to[RefV]
      name <- value("data", "name").to[String]
      age <- value("data", "age").to[Int]
    } yield (ref, name, age)
    
    refAndNameAndAge.get
    
    // or
    
    val RefAndNameAndAgeField = Field.zip(
      Field("ref").to[RefV],
      Field("data", "name").to[String],
      Field("data", "age").to[Int])
    
    value(RefAndNameAndAgeField).get

    If a value may be an array, or may contain an array, the array's elements may be cast using collect:

    value("data", "tags").collect(Field.to[String]).get
    
    // or
    
    val TagsField = Field("data", "tags").collect(Field.to[String])
    value(TagsField).get
    Annotations
    @JsonDeserialize()
  31. case class ValueReadException(errors: List[FieldError]) extends Exception with Product with Serializable

Value Members

  1. object ArrayV extends Serializable
  2. object BooleanV
  3. object BytesV extends Serializable
  4. object Codec
  5. object DateV extends Serializable
  6. object Decoder
  7. object Encoder
  8. object FalseV extends BooleanV with Product with Serializable
  9. object Field extends Field[Value]
  10. object FieldPath
  11. object FieldPathEmpty extends FieldPath with Product with Serializable
  12. object Native
  13. object NullV extends NullV with Product with Serializable
  14. object ObjectV extends Serializable
  15. object RefV extends Serializable
  16. object Result
  17. object TimeV extends Serializable
  18. object TrueV extends BooleanV with Product with Serializable
  19. object Value

    Companion object to the Value trait.

Ungrouped