Week 4 L1 Flashcards
How to insert a document ?
.insert
How to insert datasets such as JSON CSV and TSV?
use mongo import
how to specify format of import?
/type
What happens if no collection name is given ?
the collection is named from file without extension
How do you remove any blanks from insert?
/ignoreBlanks
what does upserting data mean ?
/mode upsert
Upsert inserts new data but replaces any matching data. Inserts if no match or updates if it does.
How to specify fields for upsert?
/upsertFields
How to specify field names?
/fields name
How to specify list of field names
/headerline
How to export data?
mongoexport
How to export part of a collection
/query
How to export a subset of names of fields
/fields title
how to sort a export ?
/sort
how to reduce number of exported documentes
/skip and /limit
What are indexes
Special data structures that store small portions of collections data set in a easy to traverse form. Indexes store values of specific fields or set of fields ordered by value of field. Each entry in index points to DB document.