fauna / faunadb-jvm

Scala and Java driver for FaunaDB v4

Home Page:https://fauna.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapping result example.

nandotorterolo opened this issue · comments

Hi, could you provide me an example of mapping result from Fauna database in Scala, thanks!

val result2 = client.query(
    Paginate(Ref("databases"))
  ).map{
    res => println(res.to[String])
  }
  .recover {
   case NonFatal(t) => println(s"paginate database: ${t.getMessage}")
  }

res

VFail(List(FieldError(Expected String; found value ObjectV(Map(data -> ArrayV(Vector(RefV(my-first-database,Some(RefV(databases,None,None)),None))))) of type faunadb.values.ObjectV.,/)))

Hi there,

There are a few things you can do:

If you had more questions, you're welcome to join: https://fauna-community.slack.com

ps: thanks @erickpintor, I borrowed your answer.

👍 thanks !