Goal is to be able to resolve data from a document with FQL.
It would not be merged with the data itslef but instead provided on the side in a resolved property. Main reason being that I don't want to mess-up with the editable properties with resolved ones.
Any number of resolvers could be provided per collection. They would get merge (with q.Merge) when pushed.
Basic example
A users collection has the fields profile.firstName and profile.lastName.
We would like to get the fullName for quick display.
We would create the following resolver object:
Summary
Goal is to be able to resolve data from a document with FQL. It would not be merged with the data itslef but instead provided on the side in a
resolved
property. Main reason being that I don't want to mess-up with the editable properties with resolved ones.Any number of resolvers could be provided per collection. They would get merge (with
q.Merge
) when pushed.Basic example
A users collection has the fields
profile.firstName
andprofile.lastName
. We would like to get the fullName for quick display. We would create the following resolver object:Which would end up being wrapped in a User-Defined Function:
Which when getting the following document:
would return:
Motivation
Provide the ability to fetch processed content straight from Fauna, without any in-between server.