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

Neo4j 4.0.x Limit and Skip clauses now expect params to be Neo4j.int #159

Closed
ChristopheVandePoel opened this issue Sep 25, 2020 · 2 comments · Fixed by #160
Closed

Neo4j 4.0.x Limit and Skip clauses now expect params to be Neo4j.int #159

ChristopheVandePoel opened this issue Sep 25, 2020 · 2 comments · Fixed by #160
Labels

Comments

@ChristopheVandePoel
Copy link

I refer to the following issue on the driver repo:
neo4j/neo4j-javascript-driver#547

We are in the progress of upgrading our Neo4j to 4.x and ran into the above error when using .limit(10) and .skip(10) as provided by this repository.

Steps to reproduce
Against a Neo4j 4.x, run:

     query.match([node(name, '')])
               .return(name)
               .limit(10)

expected result: first 10 records to be returned.
actual result: error thrown LIMIT: Invalid input. '10.0' is not a valid value

current workaround
replace all query.limit() and query.skip() calls with a query.raw() value

query.raw(`SKIP $skip`, { skip: neo4j.int(this.options.skip) })

Proposed fix
Replace the implementation of the limit and skip with a compatible version:

    this.amountParam = this.addParam(neo4j.int(amount), 'skipCount');

This should be bw/fw compatible, but might result in cypher snapshots during tests (like with ours) to fail.

jamesfer added a commit that referenced this issue Sep 26, 2020
Uses a neo4j integer object to pass the skip and limit parameter to neo4j. It was complaining about
the old version because it interpreted the number as a floating value.

fix #159
@jamesfer
Copy link
Owner

Hey there. Thanks for the detailed bug report. I've created a fix and should be able to deploy it soon.

jamesfer pushed a commit that referenced this issue Sep 26, 2020
## [6.0.1](v6.0.0...v6.0.1) (2020-09-26)

### Bug Fixes

* **skip,limit:** use int object for parameter ([2b18c97](2b18c97)), closes [#159](#159)

[skip ci]
@jamesfer
Copy link
Owner

🎉 This issue has been resolved in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants