views:

973

answers:

2

Hi, is there any possibility to access and retrieve data from MongoDB directly over JavaScript form browser without backend processing?

A: 

Not in the standard security context.

If you have a situation where you have elevated security rights (such as inside a custom browser extension) then it may become possible.

David Dorward
can a browser plugin i.e. for firefox solve the problem?
haki
Yes, although I doubt one exists already, so you would have to write it.
David Dorward
+1  A: 

Connections to MongoDB occur over a socket; browsers communicate via http. That said, it's not difficult to write a back-end app that gives you pretty transparent access to MongoDB via JavaScript / REST / HTTP. That's essentially what's happening with Try Mongo (http://mongo.kylebanker.com).

People have also started building some generic back-ends for this purpose. Here's one example: http://github.com/djsun/sinatra_resource

Kyle Banker
what i supposed to do is to write a stand allone application without backend which only use http for db-communication. it should work offline and sync if internet-master-db-connection is available again. it seems mongodb is not the right system for me. what i recherched is that couchdb communicates via http GET, PUT and POST-Requests
haki