https://github.com/caub/mongo-cli-java
MongoDB web command line interface
https://github.com/caub/mongo-cli-java
Last synced: 3 months ago
JSON representation
MongoDB web command line interface
- Host: GitHub
- URL: https://github.com/caub/mongo-cli-java
- Owner: caub
- Created: 2013-12-29T14:41:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T13:59:29.000Z (almost 10 years ago)
- Last Synced: 2025-03-22T22:17:55.215Z (over 1 year ago)
- Language: Java
- Homepage: http://mongocli.blogspot.fr/2014/02/mongodb-websocket-knockoutjs.html
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
mongo-cli-java
====================
MongoDB from a websocket, with extra features:
- **Access-rights** on documents
- **Notifications**
It works by sending `{fn: someFunction, args: someArguments}` following the syntax of [Mongo's Java driver](http://api.mongodb.org/java/current/com/mongodb/DBCollection.html)
Example in javascript:
send({fn:'find', args:[{a: 2}]}, function(d){console.log(d)})
send({fn:'save', args:[{a:3}]}, function(d){console.log(d)})
send({fn:'find', args:[{a: {$gt:2}}]}, function(d){console.log(d)})
send({fn:'findAndModify', args:[{a:3},{$set:{a:5,b:12}}]}, function(d){console.log(d)})
send({fn:'findAndModify', args:[{a:6},{a:5,b:12},true, false]}, function(d){console.log(d)})
send({fn:'remove', args:[{a: {$exists: true}}]}, function(d){console.log(d)})
//when you're authentified, access-rights are enabled
send({fn:'save', args:[{a:4, _canRemove:['john@gmail.com']}]}, function(d){console.log(d)})
send({fn:'save', args:[{a:5,_canRead:['john@gmail.com'],_canUpsert:['john@gmail.com'],_canRemove:['john@gmail.com']}]}, function(d){console.log(d)})
//notifications:
connected clients receive the update when their rights allow it
note: not all methods will trigger notifications findAndModify, findAndRemove do
update, remove won't since it just return the number of updates.
Server demos: [Heroku](http://mongo-cli-java.herokuapp.com/), [Cloudbees](http://mongo-cli-java.cyril.eu.cloudbees.net/)
Client demos: [Paint](http://jsbin.com/muquv/latest), [Chat](http://jsbin.com/dozik/latest), [Todos](http://jsbin.com/sonuw/latest)