I haven’t located a truly clear example of syntax for a MongoDB Update function, but I tried this:
'updateJobLocation': function(username, jobLoc, placename, st8OrProvince, postalcode, xcoord, ycoord) {
JobLocations.update( {jl_username: username },
{ $set: { jl_jobloc: jobLoc, jl_placename: placename, jl_st8OrProvince: st8OrProvince,
jl_postalcode: postalcode, jl_xcoord: xcoord, jl_ycoord: ycoord } }
});
},
It fails; I get:
W20150926-21:36:33.940(-7)? (STDERR) C:\Meteor\scheduler.meteor\local\build\pro
grams\server\app\both\methods.js:29
W20150926-21:36:33.941(-7)? (STDERR) });
W20150926-21:36:33.941(-7)? (STDERR) ^
W20150926-21:36:33.942(-7)? (STDERR) SyntaxError: Unexpected token }
I changed the code slightly (removed one of the "}"s), to this:
'updateJobLocation': function(username, jobLoc, placename, st8OrProvince, postalcode, xcoord, ycoord) {
JobLocations.update( {jl_username: username },
{ $set: { jl_jobloc: jobLoc, jl_placename: placename, jl_st8OrProvince: st8OrProvince,
jl_postalcode: postalcode, jl_xcoord: xcoord, jl_ycoord: ycoord }
});
},
…and now it complains this way:
W20150926-21:56:10.677(-7)? (STDERR) C:\Meteor\scheduler.meteor\local\build\pro
grams\server\app\both\methods.js:49
W20150926-21:56:10.678(-7)? (STDERR) { w_username: username, w_workerid:
workerid },
W20150926-21:56:10.678(-7)? (STDERR) ^
W20150926-21:56:10.678(-7)? (STDERR) SyntaxError: Unexpected token {
What’s the beef?