You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retrieving a composed view of document with multi-collection references, there needs to be information about what collection each of the documents is coming from. Currently, this is done using one field per Reference field, named as _ref[ReferenceFieldName] (e.g. authors leads to _refAuthors).
In hindsight, the naming of this internal field was a poor design decision (my bad ✋). It forces clients to compute the name of the mapping field from the name of the Reference field, with the whole camel-case conversion to add more complexity to the mix.
Instead, a single field (e.g. _references) should hold all the collection mapping, in an object where keys are the Reference field names. The response above would be changed to:
This way, consumers don't need to compute any field names. Accessing the collection mapping for the crew fields is as simple as accessing the _references.crew object.
The text was updated successfully, but these errors were encountered:
When retrieving a composed view of document with multi-collection references, there needs to be information about what collection each of the documents is coming from. Currently, this is done using one field per Reference field, named as
_ref[ReferenceFieldName]
(e.g.authors
leads to_refAuthors
).Example:
In hindsight, the naming of this internal field was a poor design decision (my bad ✋). It forces clients to compute the name of the mapping field from the name of the Reference field, with the whole camel-case conversion to add more complexity to the mix.
Instead, a single field (e.g.
_references
) should hold all the collection mapping, in an object where keys are the Reference field names. The response above would be changed to:This way, consumers don't need to compute any field names. Accessing the collection mapping for the
crew
fields is as simple as accessing the_references.crew
object.The text was updated successfully, but these errors were encountered: