Last active
December 31, 2015 19:19
-
-
Save rtomaszewski/8032489 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract the hw1 archive file | |
# change to the directory | |
$ ls | |
root@mongo2:~/hw1# ls -la | |
total 24 | |
drwxrwxr-x 3 root root 4096 Dec 18 23:57 . | |
drwxr-xr-x 11 root root 4096 Dec 18 23:57 .. | |
drwxr-xr-x 3 root root 4096 Feb 12 2013 dump | |
-rw-r--r-- 1 root root 598 Mar 27 2013 hw1-2.py | |
-rw-r--r-- 1 root root 2584 Dec 18 23:51 hw1-2.py.html | |
-rw-r--r-- 1 root root 745 Dec 18 23:57 hw1-3.py | |
$ mongorestore | |
$ mongo | |
> show dbs | |
> show collections | |
> use m101 | |
> db.funnynumbers.find().sort( {value:1 } ) | |
{ "_id" : ObjectId("50778ce69331a280cf4bcfa2"), "value" : 0 } | |
{ "_id" : ObjectId("50778ce69331a280cf4bcfbe"), "value" : 0 } | |
{ "_id" : ObjectId("50778ce69331a280cf4bcf8f"), "value" : 1 } | |
{ "_id" : ObjectId("50778ce69331a280cf4bcfb2"), "value" : 1 } | |
{ "_id" : ObjectId("50778ce69331a280cf4bcfc0"), "value" : 2 } | |
{ "_id" : ObjectId("50778ce69331a280cf4bcfda"), "value" : 2 } | |
> db.hw1.find() | |
{ "_id" : ObjectId("50773061bf44c220307d8514"), "answer" : 42, "question" : "The Ultimate Question of Life, The Universe and Everything" } | |
> db.funnynumbers.drop() | |
> db.dropDatabase() | |
{ "dropped" : "m101", "ok" : 1 } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment