Practicing with Mongo


If you’d like to actually use the Mongo command line (mongosh) to work on last Thursday’s activity, log on to cpsc and then type:

$ mongoimport --db yourusername_sw \
--collection characters \
--file /srv/cpsc350/starwars_pre_mongoActivity.json \
--jsonArray

where yourusername is your user name. Then, you can do:

$ mongosh
test> use yourusername_sw
switched to db yourusername_sw
yourusername_sw> show collections
characters

and you are now at a shell that allows you to use db.characters plus all the toppings.