arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
600 stars 106 forks source link

How to use "ForceOneShardAttributeValue" option in aqlQuery? #789

Closed gaurav-quasar closed 1 year ago

pluma4345 commented 1 year ago

Looks like this option was released without documentation but has been picked up by some other drivers. For the time being you can add it in TypeScript to the query options using type assertions. In JavaScript it already works as there's no run-time validation.

gaurav-quasar commented 1 year ago

Thanks @pluma4345 for looking into it. I'll use it with type assertion now like below:

query(query: AqlQuery): Promise<ArrayCursor> { const queryOptions = <QueryOptions> {count: true, fullCount: true, cache: false, ForceOneShardAttributeValue: true}; return this.db.query(query, queryOptions); }

pluma4345 commented 1 year ago

@gaurav-quasar We have decided not to implement this option in most drivers as it makes it very easy to misconfigure ArangoDB by using it and it was implemented in ArangoDB for internal use only and is therefore considered experimental.