As of right now, I have my MongoDB “Selects” in \server\publications.js, such as:
Meteor.publish("jobLocations", function () {
return JobLocations.find();
});
…and am subscribing to those in \client\main.js, such as:
Meteor.startup(function() {
Meteor.subscribe("jobLocations");
. . .
…but I have my Inserts/Updates/Upserts/Deletes in \both\methods.js, like so:
Meteor.methods({
'insertJobLocation': function(username, jobLoc, placename, st8OrProvince, postalcode, xcoord, ycoord) {
JobLocations.insert({
jl_jobloc: jobLoc,
. . .
…and am calling them from \client\templates\whatever.js, like so:
'submit form': function(event, template) {
. . .
Meteor.call('insertJobLocation', jobloc, placename, st8OrProvince,
postalcode, xcoord, ycoord, function(err) {
. . .
This works, but is it wrong[-headed]?
Should all the MongoDB code be published/subscribed to (IOW, located in \server\publications.js and \client\main.js?