1
votes

is it possible to not return key / system fields when returning a cursor? I'm using ArangoDB for an open data portal. I want to offer an API so my users can query datasets; _key,_rev and _id are irrelevant to them.

eg {"query":"for x in collection limit 10 return x","sysFields":false}

I've got a wrapper api in place so it would be possible for me to remove them.

Thanks

1

1 Answers

0
votes

AQL provides a function ATTRIBUTES() to return all top-level attributes of a given document, with an optional parameter to omit system fields (every attribute key that starts with an underscore), which can be used in combination with the KEEP() function to get rid of system fields:

FOR x IN collection
LIMIT 10
RETURN KEEP(x, ATTRIBUTES(x, true))