https://www.mongodb.com/

1
2
3
4
// change database
> use mydb
switched to db mydb
> db.user.find({'name': 'John Smith'}); // find the user with name "John Smith"

Update a query

1
2
// db.collection.update(criteria, value to set, upsert, multi)
> db.user.update({'name': 'John Smith'}, {$set: {email: 'john.smith@example.com'}, false, true)
Reference:

Drop database

1
$ mongo <dbname> --eval "db.dropDatabase()"
Reference: