1

I'm using arangodb cursor through javascript client

db._query('query', {param: value})

My query contains limit operator and I need a total count. How can I pass fullCount option into cursor and read extra.fullCount back.

1 Answer 1

2

If you're running the query from the ArangoShell, then the easiest should be setting the options attribute when calling db._query() like this:

var data = { 
  query: "FOR doc IN collection FILTER doc.attr == @value LIMIT 0, 5 RETURN doc", 
  bindVars: { value: "foo" }, 
  options: { fullCount: true } 
};

var result = db._query(data);
full = result.getExtra().stats.fullCount;

The options object is optional. If it contains a fullCount subattribute, the query result will contain a fullCount subattribute in its statistics. In the above example, the result is captured in variable full.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.