In the provided mongoimport command, we are importing data from a JSON file named "students.json" located in the specified directory into a MongoDB database called "collge". The data is being imported into a collection named "students". The --jsonArray option indicates that each line in the JSON file represents a separate document in the collection. Additionally, the --drop option ensures that any existing data in the "students" collection is dropped before the import, ensuring a clean import process without duplicating data.
C:\Users\user>mongoimport "C:\Users\user\Downloads\students.json" -d collge -c students --jsonArray --drop 2024-03-24T15:57:59.406+0530 connected to: mongodb://localhost/ 2024-03-24T15:57:59.413+0530 dropping: collge.students 2024-03-24T15:57:59.486+0530 8 document(s) imported successfully. 0 document(s) failed to import.