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

Kaminari with pluck #7

Open
JacobKorn opened this issue Jan 20, 2016 · 1 comment
Open

Kaminari with pluck #7

JacobKorn opened this issue Jan 20, 2016 · 1 comment

Comments

@JacobKorn
Copy link

Hi. I have a query which is starting to return too many results so I want to paginate it so the database only sends back the required data.

an example of the query is:
Invoice.as(:i).invoice_items(:ii).where_not("i--(:Processed)").page(2).per(10).pluck(:i, :ii)

the .page() and .per() are working, but as soon as the .pluck() comes into the mix it returns all results.

Am I doing this the right way, is there another way to achieve the results or is this a bug?

Thanks

@dfabreguette
Copy link

dfabreguette commented Sep 15, 2016

Noticed that as well !

I used "return" instead before calling page/per methods.

This returns me a Struct ruby object with a property of the return label.

In my case it's named "s".

n.query_as(:u).match('(s:SuiviNode)-[:intended_for]->(u)').return(:s).page(1).per(4).collect(&:s).collect(&:activity_id)

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