importFile() - Import JSON documents from file command
Imports JSON documents from a file into a collection.
Syntax diagram
Command parameters
- file_name
- This parameter specifies the fully qualified name of a file from which to import data.
- commit_frequency
- This optional parameter specifies the batch size for commit operations. Larger batches generally improve performance.
Example
Import documents from a file that
is named books.
db.books.importFile("C:\\books.js")Sample
output is as follows:28 objects were imported in 4030 milliseconds. 