Package

faunadb

values

Permalink

package values

Visibility
  1. Public
  2. All

Type Members

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

    Permalink

    An Array.

  2. sealed abstract class BooleanV extends ScalarValue

    Permalink

    A Boolean value.

  3. case class BytesV(bytes: Array[Byte]) extends ScalarValue with Product with Serializable

    Permalink
  4. trait Codec[T] extends Decoder[T] with Encoder[T]

    Permalink
  5. case class DateV(localDate: LocalDate) extends ScalarValue with Product with Serializable

    Permalink

    A Date value.

  6. trait Decoder[T] extends AnyRef

    Permalink
  7. case class DoubleV(value: Double) extends ScalarValue with Product with Serializable

    Permalink

    A Double value.

  8. trait Encoder[T] extends AnyRef

    Permalink
  9. sealed abstract class Field[T] extends AnyRef

    Permalink
  10. case class FieldError(error: String, path: FieldPath) extends Product with Serializable

    Permalink
  11. sealed abstract class FieldPath extends AnyRef

    Permalink
  12. case class FieldPathField(field: String) extends FieldPath with Product with Serializable

    Permalink
  13. case class FieldPathIdx(idx: Int) extends FieldPath with Product with Serializable

    Permalink
  14. case class FieldPathNode(l: FieldPath, r: FieldPath) extends FieldPath with Product with Serializable

    Permalink
  15. case class LongV(value: Long) extends ScalarValue with Product with Serializable

    Permalink

    A Long value.

  16. sealed trait NullV extends Value

    Permalink

    The Null value.

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

    Permalink

    An Object value.

  18. case class QueryV(lambda: ObjectV) extends Value with Product with Serializable

    Permalink
  19. case class RefV(value: String) extends ScalarValue with Product with Serializable

    Permalink

    A Ref.

  20. sealed abstract class Result[+T] extends AnyRef

    Permalink
  21. sealed trait ScalarValue extends Value

    Permalink

    Base trait for all scalar values.

    Base trait for all scalar values.

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

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

    Permalink

    A Set Ref.

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

    Permalink

    A String value.

  24. case class TimeV(time: HighPrecisionTime) extends ScalarValue with Product with Serializable

    Permalink

    A Timestamp value.

  25. final case class VFail extends Result[Nothing] with Product with Serializable

    Permalink
  26. final case class VSuccess[+T] extends Result[T] with Product with Serializable

    Permalink
  27. sealed trait Value extends AnyRef

    Permalink

    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()
  28. case class ValueReadException(errors: List[FieldError]) extends Exception with Product with Serializable

    Permalink

Value Members

  1. object ArrayV extends Serializable

    Permalink
  2. object BooleanV

    Permalink
  3. object BytesV extends Serializable

    Permalink
  4. object DateV extends Serializable

    Permalink
  5. object Decoder

    Permalink
  6. object FalseV extends BooleanV with Product with Serializable

    Permalink
  7. object Field extends Field[Value]

    Permalink
  8. object FieldPath

    Permalink
  9. object FieldPathEmpty extends FieldPath with Product with Serializable

    Permalink
  10. object NullV extends NullV with Product with Serializable

    Permalink
  11. object ObjectV extends Serializable

    Permalink
  12. object RefV extends Serializable

    Permalink
  13. object Result

    Permalink
  14. object TimeV extends Serializable

    Permalink
  15. object TrueV extends BooleanV with Product with Serializable

    Permalink
  16. object Value

    Permalink

    Companion object to the Value trait.

  17. package time

    Permalink

Ungrouped