importMongo() - Import JSON documents from MongoDB

Import JSON documents from a collection in a MongoDB database.

Syntax diagram

Read syntax diagramSkip visual syntax diagramdb.collection. importMongo(hostname,portnr ,dbname,collection userid,?pwd )

Command parameters

hostname
This argument specifies the name of the server that hosts the MongoDB database.
portnr
This argument specifies the port number of the MongoDB database.
dbname
This argument specifies the database name of the MongoDB database.
collection
This argument specifies the collection name in the MongoDB database.
userid
This optional argument specifies the user name with which to connect to the MongoDB database.
pwd
This optional argument specifies the password for this user name.

Example

Example 1: Update the specified fields in a document.
db.test.importMongo("remoteServer", 27017, "medialib", "DVD")