Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with ViewQuery #2

Closed
joques opened this issue Apr 7, 2017 · 3 comments
Closed

Example with ViewQuery #2

joques opened this issue Apr 7, 2017 · 3 comments

Comments

@joques
Copy link

joques commented Apr 7, 2017

Hi,
could you possibly add an example with ViewQuery? I am trying to implement one but don't know how to structure it. I am mostly lost regarding the result: QueryResult[ViewRow[T], NotUsed.
An example will certainly clarify things for me.
Thanks

@mathieuancelin
Copy link
Member

mathieuancelin commented Jun 1, 2017

Hi,

I guess you can do something like

val usersUnder43: Future[Seq[JsValue]] = bucket.searchView(
  ViewQuery("persons", "by_age", 
    _.stale(Stale.FALSE).includeDocs(true).startKey(0).endKey(42)) 
).flatMap(d => Source.fromFuture(d.doc)).asSeq

@mathieuancelin
Copy link
Member

@joques does it work for you ?

@mathieuancelin
Copy link
Member

@joques I'll close the issue for the moment but feel free to reopen it if you encounter issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants