Meteor subscribed data doesn't join(extend) together

i have 2 different publications that subscribe to the same document but different fields. eg.

Meteor.publish('myAvatar',function(){
	return User.find({
		_id : Meteor.userId()
	}, {
		fields : {
			"profile.images.avatar" : 1
		}
	});
});

Meteor.publish('myBanner',function(){
	return User.find({
		_id : Meteor.userId()
	}, {
		fields : {
			"profile.images.banner" : 1
		}
	});
});

when i do

if (Meteor.userId()){
	this.subscribe("myAvatar");
	this.subscribe("myBanner");
}

result i get

{
	profile : {
		images : {
			avatar : [...]
		}
	}
}

what i expect

{
	profile : {
		images : {
			avatar : [...]
			banner : [...]
		}
	}
}

the second subscription fields doesn’t extend to 1st subscription data

currently using 1.6-beta.31 with latest node & npm

any clue?

What if you disable the Avatar subscription and only subscribe to the Banner? Do you get it then?

yes, i get the banner when i remove the avatar subscription

This is a known limitation of the mergebox. Only top level fields are merged.

1 Like

Oh, that’s kind of dangerous isn’t it :open_mouth: Never noticed that.

omg :disappointed_relieved: this is very disappointing, i didn’t notice that until recently i decided to optimize my app by subscribing only what i needed.

this defeat the purpose of using mongodb nested object and minimize data on the wire