Question

I'm reading around and see that it is a bad idea to have remote application talk directly to my MongoDB e.g. install a Mongodb driver in a phone app. The best way is to have a REST interface on a server to talk between the database and the end user. But what about the aggregation framework?

I see Sleepy.mongoose and Eve but I cannot see anything about aggregation. Is there any way/or REST interface which allows you to make aggregation calls (I'm interested in subdocuments)?

E.g. requesting $ curl 'http://localhost:27080/customFunction/Restaurant' and return all the subdocuments matching shop.kind with Restaurant.

I'm familiar with python and java, is there any API framework that allows you to do that?

Was it helpful?

Solution

Before you get flagged as off-topic as you likely will for asking for opinions and not a specific programming question I'll just say one bit. Hopefully on-topic.

I highly doubt that most projects will go beyond being a basic CRUD adaptor allowing you access to collection objects and sometimes (badly) database objects. Is with their various ORM backed counterparts they will do doubt allow a similar query syntax to be executed from the client, so queries could be composed and sent through as JSON, which will not surprisingly look much like (identical) to the standard query syntax for MongoDB.

For myself I prefer to roll my own, and largely because you may want to implement a lot of customer behavior and actions, and in some way abstract a little from having a lot of CRUD code in the client. Let's face it, you're probably passing through and passing JSON that is going into the native structures you're using anyway. So it's not hard really. Anyhow, each to his own I suppose.

There is a listing of other implementations on available here:

http://docs.mongodb.org/ecosystem/tools/http-interfaces/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top