Open Steve1820 opened 5 years ago
In your publish query there is _id and in your client query there is id. Guess that could cause some discrepancy.
@Nauzer Thanks I updated my post and fixed it in my code but the problem still persists.
Is it working in your projects?
Haven't used the library in a while... but I think so.
On the client you should query 'quests' collection, not the publication name.
Meteor.collection('quests').find({'_id': id})
Do you have 'autopublish' turned off on your Meteor server?
I dont have autopublish turned off - will this affect behaviour?
Apologies for being an absolute noob.
@Nauzer thanks it worked!!!
Hey guys,
I've been struggling with this for days. I have my server set up as:
Meteor.publish('quests_filtered', (id) => { return Quests.find({'_id': id}); });
And my client like the below. You can think of quests exactly like a to do list.
export default withTracker(params => { Meteor.subscribe('quests_filtered', params.id); return { quests: Meteor.collection('quests_filtered').find({'_id': id}), }; })(QuestFeed);
The collection is defined as:
const Quests = new Mongo.Collection('quests');
However this.props.quests in the client side still returns the whole Quests collection and not those filtered by id.
I am at a complete loss - any ideas?