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. class CodecMacro extends AnyRef

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

    Permalink

    A Date value.

  7. trait Decoder[T] extends AnyRef

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

    Permalink

    A Double value.

  9. trait Encoder[T] extends AnyRef

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

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

    Permalink
  12. sealed abstract class FieldPath extends AnyRef

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

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

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

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

    Permalink

    A Long value.

  17. sealed trait NullV extends Value

    Permalink

    The Null value.

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

    Permalink

    An Object value.

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

    Permalink
  20. trait RecordCodec[T] extends Codec[T]

    Permalink
  21. case class RefV(id: String, collection: Option[RefV] = None, database: Option[RefV] = None) extends ScalarValue with Product with Serializable

    Permalink

    A Ref.

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

    Permalink
  23. sealed abstract class 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.

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

    Permalink

    A Set Ref.

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

    Permalink

    A String value.

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

    Permalink

    A Timestamp value.

  27. trait UnionCodec[T] extends Codec[T]

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

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

    Permalink
  30. 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()
  31. 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 Codec

    Permalink
  5. object DateV extends Serializable

    Permalink
  6. object Decoder

    Permalink
  7. object Encoder

    Permalink
  8. object FalseV extends BooleanV with Product with Serializable

    Permalink
  9. object Field extends Field[Value]

    Permalink
  10. object FieldPath

    Permalink
  11. object FieldPathEmpty extends FieldPath with Product with Serializable

    Permalink
  12. object Native

    Permalink
  13. object NullV extends NullV with Product with Serializable

    Permalink
  14. object ObjectV extends Serializable

    Permalink
  15. object RefV extends Serializable

    Permalink
  16. object Result

    Permalink
  17. object TimeV extends Serializable

    Permalink
  18. object TrueV extends BooleanV with Product with Serializable

    Permalink
  19. object Value

    Permalink

    Companion object to the Value trait.

Ungrouped