in the following example this
is the Meteor object:
Meteor.publish('events', function() {
console.log(this)
return Events.find({
$or: [
{
$and: [
{"public": true},
{"public": {$exists: true}}
]
},
{
$and: [
{owner: this.userId},
{owner: {$exists: true}}
]
}
]
})
})
while in this example this
is something entirely different that doesnât have the userId parameter:
Meteor.publish('events', () => {
console.log(this)
return Events.find({
$or: [
{
$and: [
{"public": true},
{"public": {$exists: true}}
]
},
{
$and: [
{owner: this.userId},
{owner: {$exists: true}}
]
}
]
})
})
is this a bug?