Fix to just project the exact fields are declared on columns and extraFields #454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tabular has an amazing feature that is take care of the publications to just publish the fields are defined in columns and extraFields.
But there was an issue when you have a document/object with sub-documents, because the code
fields[cleanFieldName(data)] = 1;
execute
cleanFieldName
function to set what fields should be projected. When you have subdocuments and per example you set a column data withparent.child
,cleanFieldName
will get just theparent
, then if you have a big document, all that fields will be published. This can be a security issue too.I changed that line to doesn't clean the the field name, than unnecessary fields will be published.
fields[data] = 1;
This simple change will save a lot of traffic but can have a little negative impact on systems that are using another subdocuments that are not explicit published. Anyway, I guess this is a important change.