Skip to content

MongoDB Commands

13mtfb edited this page Dec 13, 2017 · 2 revisions

Importing a collection from a .csv file

This command is used to import a development collection to test database functionality. It assumes the .csv file contains a headerline with the schema being used for the collection.

mongoimport -h ds057204.mlab.com:57204 -d elec498_dev -c <collection> -u <user> -p <password> --file <input .csv file> --type csv --headerline

>C:\Program Files\MongoDB\Server\3.4\bin>mongoimport -h ds057204.mlab.com:57204 -d elec498_dev -c textbooks_dev -u admin -p sammattxander --file C:\Users\Matthew\Documents\github\testfiles\mongodb\textbooks_dev.csv --type csv --headerline

USERS

    PUSH /create

    GET /validate

Clone this wiki locally