Closed shengc closed 9 years ago
I think you should do
table.filter(author=> author("name") === "Williams Adama").run
or
table.filter(author=> author\"name" === "Williams Adama").run
or
table.filter(author => author("name") eq "Williams Adama" ).run
You don't have to actually return the result inside the the filter.. run
actually terminates the query and then executes on the server side.
Note sometimes scala will get confused with method like eq
and ne
(due to scala adds these methods to every object by default) for that reason there are custom methods that get around this limitation === (eq) =!= (ne)
This should fix your query but there is indeed a error in not being able to map the json error correctly
than you, that works! I actually tried another filter by size of the posts,
filter(author => (author \ "name").toSeq[Post] === 1)
it works too!
Actually surprised the toSeq query worked, seems a bit incorrect.. guess you meant
filter(author => (author \ "posts").toSeq[Post].count() === 1)
In any case glad you got it working
Sorry to be a pain in the ass. I was trying the 10 minute tutorial from rethink db website using scala driver, and got stuck in the step of "filter by author's name". What I am doing is as follows,
it always ends up with this error,
I also tried added JsonProperty("type") annotation to the name field of Author, not working either. I know I am probably doing something wrong in the code, but there is very little clue I can find in the readme or quickly start of the project. Could you take a look ?