Hi,
After update to Meteor 2.2 this publish started to fail.
Meteor.publish('clapsForPoemByUser', function(poemId) {
return Claps.find(
{ poemId },
{
fields: {
usersclaps: { $elemMatch: { userId: this.userId } },
'usersclaps.claps': 1
}
},
}
Returned error is:
I20210529-22:58:56.780(2)? Exception from sub clapsForPoemByUser id oTQsETkYuHqdDkTFa Error: Exception while polling query {"collectionName":"claps","selector":{"poemId":"5ms7mgzLBQjAcDscq"},"options":{"transform":null,"fields":{"usersclaps":{"$elemMatch":{"userId":"8hqK63ZmjxbEc4SqB"}},"usersclaps.claps":1}}}: Path collision at usersclaps.claps remaining portion claps
I20210529-22:58:56.780(2)? at PollingObserveDriver._pollMongo (packages/mongo/polling_observe_driver.js:165:11)
I20210529-22:58:56.781(2)? at Object.task (packages/mongo/polling_observe_driver.js:93:12)
I20210529-22:58:56.781(2)? at Meteor._SynchronousQueue.SQp._run (packages/meteor.js:917:16)
I20210529-22:58:56.781(2)? at packages/meteor.js:894:12
When I remove this line it starts to work.
usersclaps: { $elemMatch: { userId: this.userId } },
Any idea why?