I've been trying to store server side functions in MongoDB (from the client side)
I'm trying this, from the examples:
db.system.js.save({_id: "sum",
value: function (x, y) { return x + y; }});
But that does not work. I am using Mongoose, so I don't know if it has a wrapper around the plain Mongo DB object.
Use the mongoose-function plugin to add function support to mongoose.
Then create a schema and force its collection name:
new Schema({ value: Function }, { collection: 'system.js' })