Answer the question
In order to leave comments, you need to log in
Why is the document not being published from the collection?
Good afternoon.
When a collection is published, it is not passed to the client.
Publishing occurs in the following way
Meteor.publish('battles', function ()
{
var x=this.user().username;
return battles.find({ $or: [ { name1: x}, { name2: x} ] },{fields:{name1:1,name2:1,battleID:1}})
});
Answer the question
In order to leave comments, you need to log in
Unfinished address to the field is all to blame
Meteor.publish('battles', function ()
{
var x = Meteor.users.findOne({_id: this.userId});
return battles.find({ $or: [ { name1: x.username}, { name2: x.username} ] },{fields:{name1:1,name2:1,battleID:1}});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question