Should MongoDB Inserts/Updates/Upserts/Deletes be published?

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() {
 . . .

…but I have my Inserts/Updates/Upserts/Deletes in \both\methods.js, like so:

    'insertJobLocation': function(username, jobLoc, placename, st8OrProvince, postalcode, xcoord, ycoord) {
            jl_jobloc: jobLoc,
	. . .

…and am calling them from \client\templates\whatever.js, like so:

'submit form': function(event, template) {
    . . . '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?


As per my point of view it should be published. If you need more help about Loading data into MongoDB (Upsert, Delete, Update). Feel free to discuss

I will be happy to serve you.

Or You can follow this link

Loading data into MongoDB (Upsert, Delete, Update)

Not familiar with MongoDB but here is a possible resource.

All the things About MongoDB is discussed properly all Feel free to visit

Hope it will help… :slight_smile: