Skip to content

Instantly share code, notes, and snippets.

@jrask
Created October 2, 2012 10:40
Show Gist options
  • Save jrask/3818109 to your computer and use it in GitHub Desktop.
Save jrask/3818109 to your computer and use it in GitHub Desktop.
mongo-proxy-api
mongodb.request.get({
baseUri:'http://localhost:8000',
database:'demo',
collection:'demo',
method:'_find',
criteria:{name:'johan'},
sort:{age:mongodb.sort.ASC},
user:'demo',
passwd:'demo123',
error:function (data) {
alert(JSON.stringify(data))
},
success:function (data) {
$.each(data.results, function (_, value) {
handleRow(value);
});
}
})
function handleRow(row) {
var name = row.name
var age = row.age
console.log(name + ' is ' + age + ' years old' )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment