Pacific-Design.com

    
Home Index

1. Perl5

2. MongoDB

+ Browse

+ Console

+ Index

+ Large Inserts

+ Query

Perl5 / MongoDB /

Install MongoDB

apt-get install mongodb

Command Line

show dbs                     show database names
use <db name>                set curent database to <db name>

show collections             show collections in current database
show users                   show users in current database
show profile                 show most recent system.profile entries with time >= 1ms

Drop Database called "mydb"

use mydb 
db.dropDatabase();

Delete Collections

use mydb
db.people.drop()                           drop the entire people collection
db.people.remove()                         remove all objects from the people collection
db.people.remove( { lastname : "Wall" } )  remove object from the collection where last name is Wall