command line and gui client for mongodb · 01 ourse epartment pres indexes ongos> connect dialog...

8
19/08/2015 1 Mongo and Umongo Command line and GUI Client for MongoDB Mongo Command Line Run in a command line shell – use ‘cmd’ in windows Run by typing mongo Type mongo --host mqr1.cs.stir.ac.uk –u (username) –p (password) (dbname) You can try it online here http://try.mongodb.org/ Use the up arrow key to move through history of commands

Upload: doanxuyen

Post on 13-Apr-2018

216 views

Category:

Documents


3 download

TRANSCRIPT

19/08/2015

1

Mongo and Umongo

Command line and

GUI Client for MongoDB

Mongo Command Line

• Run in a command line shell – use ‘cmd’ in windows

• Run by typing mongo

• Type mongo --host mqr1.cs.stir.ac.uk

–u (username) –p (password) (dbname)

• You can try it online here

• http://try.mongodb.org/

• Use the up arrow key to move through history of commands

19/08/2015

2

UMongo

• GUI Client for MongoDB

• Free

• Does most simple things you’d want

• Lacks a simple command line! Use the mongo

command line

• A better tool is MongoVUE

– Free for single users – so put it on your own

machine

19/08/2015

3

Connect

Create a Collection

19/08/2015

4

Import a File

Examine Collection Contents

• Leave all blank to list

everything

• Type a query to limit

search

• Choose fields to return

19/08/2015

5

Examine a Document

Count

19/08/2015

6

Distinct

Group

function(obj,out){ out.count += 1; }

19/08/2015

7

Group

function(out){ out.av = out.totpop/out.count; }

Create Index1

2

3

19/08/2015

8

MapReduce1

2

3 function(key,values){

var depts="";

values.forEach(function(v){depts+=v});

return depts;

}