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
Since the $merge operation does not concatenate or intersect arrays, but rather overwrites them wholesale, it is basically nonsensical for the top-level node under the with property of the $merge schema to be an array. For example, this would not produce a valid schema post merge:
Because this is the case, would it be possible to have the with property support an array, which would then be interpreted as a series of consecutive merges?
Is there interest in implementing this? I doubt it would ever break existing functionality, since top-level arrays under with already always produce invalid schemas, and I think it would be pretty easy to implement. If this feels like something worth doing, I can submit a quick PR.
The text was updated successfully, but these errors were encountered:
azaslavsky
changed the title
Feature Request: Support arrays of objects to be merged in the "with" property
Feature Proposal: Support arrays of objects to be merged in the "with" property
Oct 10, 2017
I suggest that the "source" and "with" properties are replaced with an array. These properties are not needed to perform a compound merge and just add unnecessary indentation. For example (based on Alex's example):
Since the
$merge
operation does not concatenate or intersect arrays, but rather overwrites them wholesale, it is basically nonsensical for the top-level node under thewith
property of the$merge
schema to be an array. For example, this would not produce a valid schema post merge:Because this is the case, would it be possible to have the
with
property support an array, which would then be interpreted as a series of consecutive merges?Is there interest in implementing this? I doubt it would ever break existing functionality, since top-level arrays under
with
already always produce invalid schemas, and I think it would be pretty easy to implement. If this feels like something worth doing, I can submit a quick PR.The text was updated successfully, but these errors were encountered: