Hi everyone,
I have a collection in my MongoDB database with 60,000 documents. However, I don’t need to return them all into my application.
Here’s an example of the data
I want to be able to narrow down the results based on if the Category field contains either the word CONV or CUMWR. What I have at the moment looks like this:
Meteor.publish('statistics', function publishSomeData() {
return statistics.find({ "Category" : /.*CONV.*/ });
return statistics.find({ "Category" : /.*CUMWR.*/ });
});
In my application however, this only shows me the data containing CONV and not CUMWR.
I also tried doing this:
Meteor.publish('statistics', function publishSomeData() {
return statistics.find({ "Category" : /.*CONV.*/ }, { "Category" : /.*CUMWR.*/ });
});
But again the same issue occurs.
Can any body let me know what i’m doing wrong here?
Many thanks,
George
NOW SOLVED
Installed the smart publish package and now works like this:
Meteor.smartPublish('statistics', function publishSomeData() {
return [
statistics.find({ "Category" : /.*CONV.*/ }),
statistics.find({ "Category" : /.*CUMWR.*/ })
]
});