Java Driver Pass Query Options

24 views
Skip to first unread message

JPatrick Davenport

unread,
Jan 5, 2015, 12:31:14 PM1/5/15
to aran...@googlegroups.com
Hello,
I'm looking to leverage a feature added in 1.4 as described in https://github.com/triAGENS/ArangoDB/issues/558. I need to pass options to the along with query.

From the defect, it should be possible, at an HTTP level to have

devel now has such feature for the POST /_api/cursor REST API, if you set the options.fullCount attribute in the request:

{
  "query":"FOR i IN 1..1000 FILTER i > 500 FILTER i < 993 LIMIT 10 RETURN i", 
  "options":{ 
    "fullCount": true 
  }
}

this request will return:

{
  "result":[501,502,503,504,505,506,507,508,509,510],
  "hasMore":false,
  "extra":{
    "fullCount":492
  },
  ...
}

I don't see how to do that in the Java driver. I'm using the following Java driver.
Repository: arangodb-java-driver
Author: ArangoDB GmbH

Thanks,
JPD

Jan

unread,
Jan 6, 2015, 6:37:30 AM1/6/15
to aran...@googlegroups.com
Hi JPD,

I just added that feature to the driver:
https://github.com/arangodb/arangodb-java-driver/commit/ba4cfebf2c687fcc34dec37a43fb35586fb068df

We now need to update the packages and post here when that's done.
Best regards
Jan

Jan

unread,
Jan 6, 2015, 10:59:41 AM1/6/15
to aran...@googlegroups.com
Hi JPD,

the packages for the Java driver have been updated and published:
https://oss.sonatype.org/content/repositories/snapshots/com/arangodb/arangodb-java-driver/

The changes are contained in the 2.3-SNAPSHOT and 2.4-SNAPSHOT packages.

The executeQuery() method is now overloaded so the extra "fullCount" parameter can be used.
The result of the method is a cursor entity, which now provides a method getFullCount().

I hope this is what you were looking after.
Best regards
Jan
Reply all
Reply to author
Forward
0 new messages