meteor-tabular
meteor-tabular copied to clipboard
Remove autopublish for sub-documents
Is your feature request related to a problem? Please describe.
I'm using Tabular with a collection with many fields and a lot of them in subdocuments Example:
{
_id: 'aaaaa',
subDoc1: {
field1: 'a',
field2: 'b',
},
subDoc2: {
field3: 'c',
field4: 'd',
}
}
So when I want to create a tabular with the field1 and field3, I just put definition of data as 'subDoc1.field1', and 'subDoc2.field3'. This works fine, no issues The problem is that Tabular publish just use the top level field name to publish the document. Then, all fields are being published to the client.
Describe the solution you'd like
I took a look on the code and see in the file tableInit.js
a line that remove the sub-fields name, returning just the main level of the fields. The line is 36 with the code:
fields[cleanFieldName(data)] = 1;
Describe alternatives you've considered None
Additional context
I did a test to my scenario removing the cleanFieldName call, and all the functions seems as fine. new code:
fields[data] = 1;
Just to understanding, with this change I could reduce data size on client in 80% in my case, and I don't expose any unnecessary data to client.
Thank you for submitting this issue!
We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.
However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee your issues to be solved within certain time.
If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.
Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know
Hey @raragaodl, that seems like a sensible update. Can you create a PR and I'll try review ?
I can publish a new version or beta version, if needed
Great guys, I will create a PR.
@lynchem @jankapunkt , PR created.