2

I am trying to query a document. Before I return the document, I need to delete some attributes like _id, _rev and add a few other calculated attributes. How can I achieve this?

darkheir
  • 8,844
  • 6
  • 45
  • 66
IMForce
  • 37
  • 6

1 Answers1

4

To remove some attributes you can use the UNSET functions:

FOR item in collection
    RETURN UNSET(item, "_id", "_key", "_rev")

Regarding calculating new attributes it mostly depends on what you want to achieve but there are a lot of available functions in AQL. If you give us a bit more details we could find what works for you!

Sources:

darkheir
  • 8,844
  • 6
  • 45
  • 66