package values
- Alphabetic
- Public
- All
Type Members
-
case class
ArrayV(elems: Vector[Value]) extends Value with Product with Serializable
An Array.
-
sealed abstract
class
BooleanV extends ScalarValue
A Boolean value.
- case class BytesV(bytes: Array[Byte]) extends ScalarValue with Product with Serializable
- trait Codec[T] extends Decoder[T] with Encoder[T]
- class CodecMacro extends AnyRef
-
case class
DateV(localDate: LocalDate) extends ScalarValue with Product with Serializable
A Date value.
- trait Decoder[T] extends AnyRef
-
case class
DoubleV(value: Double) extends ScalarValue with Product with Serializable
A Double value.
- trait Encoder[T] extends AnyRef
- sealed abstract class Field[T] extends AnyRef
- case class FieldError(error: String, path: FieldPath) extends Product with Serializable
- sealed abstract class FieldPath extends AnyRef
- case class FieldPathField(field: String) extends FieldPath with Product with Serializable
- case class FieldPathIdx(idx: Int) extends FieldPath with Product with Serializable
- case class FieldPathNode(l: FieldPath, r: FieldPath) extends FieldPath with Product with Serializable
-
case class
LongV(value: Long) extends ScalarValue with Product with Serializable
A Long value.
- case class MetricsResponse(value: Value, metricsMap: Map[Metrics, String]) extends Product with Serializable
-
sealed
trait
NullV extends Value
The Null value.
-
case class
ObjectV(fields: Map[String, Value]) extends Value with Product with Serializable
An Object value.
- case class QueryV(lambda: ObjectV) extends Value with Product with Serializable
- trait RecordCodec[T] extends Codec[T]
-
case class
RefV(id: String, collection: Option[RefV] = None, database: Option[RefV] = None) extends ScalarValue with Product with Serializable
A Ref.
- sealed abstract class Result[+T] extends AnyRef
-
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.
-
case class
SetRefV(parameters: Value) extends ScalarValue with Product with Serializable
A Set Ref.
-
case class
StringV(value: String) extends ScalarValue with Product with Serializable
A String value.
-
case class
TimeV(toInstant: Instant) extends ScalarValue with Product with Serializable
A Timestamp value.
- trait UnionCodec[T] extends Codec[T]
- final case class VFail extends Result[Nothing] with Product with Serializable
- final case class VSuccess[+T] extends Result[T] with Product with Serializable
-
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()
- case class ValueReadException(errors: List[FieldError]) extends Exception with Product with Serializable
Value Members
- object ArrayV extends Serializable
- object BooleanV
- object BytesV extends Serializable
- object Codec
- object DateV extends Serializable
- object Decoder
- object Encoder
- object FalseV extends BooleanV with Product with Serializable
- object Field extends Field[Value]
- object FieldPath
- object FieldPathEmpty extends FieldPath with Product with Serializable
- object Metrics extends Enumeration
- object Native
- object NullV extends NullV with Product with Serializable
- object ObjectV extends Serializable
- object RefV extends Serializable
- object Result
- object TimeV extends Serializable
- object TrueV extends BooleanV with Product with Serializable
-
object
Value
Companion object to the Value trait.