MongoDB - Rockmongo - Overview - Query - Import, export - Execute/Command line
Rockmongo - Overview PHP (~ phpMyAdmin) php/wiki/rock_mongo php/wiki/rock_mongo Basic
Rockmongo – Query Query ◦ Multiple (AND, OR) conditions ◦ Not equal conditions Contextual menu Limit: fields, records
AND OR REGEX { "organization.$id": ObjectId(“xxx"), "slug": {$regex: "o"} } { "slug": {$regex: "o"} } { $or : [ {"slug": "sos"}, {"slug": "st-goran"} ] } { "slug": {$in: ["sos","st-goran"]} }
Rockmongo Query & Update Query & Delete
Rockmongo - Execute //Cursor function () { var titles = ''; var blogs = db.Blog.find({slug:{$regex: ‘blog'}}); blogs.forEach( function(x) { titles += x.title}); return titles; } function () { var titles = ''; var blogs = db.Blog.find({slug:{$regex: 'blog'}}); blogs.forEach( function(x) { x.dustin = 12; titles += x.title; db.Blog.save(x); }); return titles; } function () { var titles = ''; var blogs = db.Blog.find({slug:{$regex: 'blog'}}); blogs.forEach( function(x) { x.dustin = getUniqedId(); titles += x.title; db.Blog.save(x); }); return titles; } function getUniqedId() { return new Date().getTime(); }