Publishing same document twice is limiting fields

So this is a little odd and i do not remember having this issue in the past so it could be something with 1.2 or maybe with publish composite since they are two new variables in my newest application. Anyways the issue is that if I publish a document and limit the fields to say { fields : { name: 1 } } and that publication has to with say notifications. Well if i navigate to a page about that document and make another subscription which selects fields like { fields : { name : 1, location : 1, userId : 1, something : 1 } } that document will still only have { fields : { name: 1 } } fields what could be causing this?

It should work. Are you sure you wait for the subscription to be ready before you check the values?

Yeh, I also checked the data in the console and it was missing information as well

Here is an image from the console

If you notice the one on the left is missing services[]

I suspect the reason why the record on the left does not have a services object is because the document data itself does not contain any entry named “services”.
I have found that when a field is not populated the service excludes the field rather than the name of the field and the value null.

@johnar the document does have the field services[]. If i clear the documents from the notification feed by marking them as read the notification publication doesnt send the user document down and then my page subscription is the one that pulls the data and as you can see “Vivian” now has her services published.

OK sorry I was barking up the wrong tree!

This is actually a limitation with the merge box only merging changes to documents on top level fields. Any deeper structure is overwritten if sub fields are published successively. For more info try https://meteorhacks.com/understanding-mergebox

1 Like

I’m currently experiencing this issue. Have any workarounds / solutions been developed?

There are two subscriptions:
1- to get basic user data, for preview purposes
2 - to get more data, for when you view the users profile

Unfortunately, if subscription 1 is running, then subscription 2 will not retrieve all the profile[fields].