use test

switched to db test
Step 1: insert two documents via mongo shell ensure mongod is up & running
db.collName.insert({“name”:”nagendra”,”country”:”india”,”Age”:25})
db.collName.insert({“name”:”nagendra”,”country”:”india”,”Age”:25})
Step 2: Retrieve inserted documents
1. db.collName.find()  or   2. db.collName.find().pretty()

Step 3: open new command prompt for Import / Export operations

Ensure you were in C:\windows\system32> , refer snap below which is marked in yellow

step 4 : Execute below mongoexport command by giving proper file path

mongoexport –db test –collection collName –out D:/jsonexported.json

ensure file path like D:/folder1/folder2/jsonexported.json

Step 5: Execute below mongoimport command

mongoimport –db dbName –collection collName –file D:\jsonexported.json

ensure file path like D:\folder1\folder2\jsonexported.json

9989

56

Happy coding !!