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. case class MetricsResponse(value: Value, metricsMap: Map[Metrics, String]) extends Product with Serializable
  18. sealed trait NullV extends Value

    The Null value.

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

    An Object value.

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

    A Ref.

  23. sealed abstract class Result[+T] extends AnyRef
  24. 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.

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

    A Set Ref.

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

    A String value.

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

    A Timestamp value.

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

    A FaunaDB value.

    A FaunaDB value.

    Reference: Fauna Data Types

    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()
  32. 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 Metrics extends Enumeration
  13. object Native
  14. object NullV extends NullV with Product with Serializable
  15. object ObjectV extends Serializable
  16. object RefV extends Serializable
  17. object Result
  18. object TimeV extends Serializable
  19. object TrueV extends BooleanV with Product with Serializable
  20. object Value

    Companion object to the Value trait.

Ungrouped