I have POST, PUT, GET, and DELETE routes inside MongoDBServices with app.Group that do the obvious for most of my database objects. Taking the MeteorJS approach to create a MongoDB client on the client/browser would take this pain away. The idea would be to create a single group (/mongoServices) that handles all the MongoDb requests (/mongoServices/:collection/find, /mongoServices/:collection/insert, etc), and create an object on the client that requests to those routes.
The idea is that you'd be able to write code like this on the client
Given that Mongo is almost JSON, the real issue would be more authorization and security: you'd have to be able to restrict find and update given the permissions of the user over the collection.
I'll give it a try one of this days and how it plays out. Whats your take on this?
I have
POST
,PUT
,GET
, andDELETE
routes insideMongoDBService
s with app.Group that do the obvious for most of my database objects. Taking the MeteorJS approach to create a MongoDB client on the client/browser would take this pain away. The idea would be to create a single group (/mongoServices
) that handles all the MongoDb requests (/mongoServices/:collection/find
,/mongoServices/:collection/insert
, etc), and create an object on the client that requests to those routes.The idea is that you'd be able to write code like this on the client
or more generally
Given that Mongo is almost JSON, the real issue would be more authorization and security: you'd have to be able to restrict
find
andupdate
given the permissions of the user over the collection.I'll give it a try one of this days and how it plays out. Whats your take on this?