0% found this document useful (0 votes)
29 views1 page

MongoDB Import Export Exercises

The document outlines exercises for importing and exporting data in MongoDB using a 'students.json' file. It includes tasks for importing data into a 'college' database, querying student information, exporting the collection, and modifying the data for re-import. Specific operations include displaying all students, filtering by department and marks, counting records, and updating the collection with new entries.

Uploaded by

Surya Alakanti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

MongoDB Import Export Exercises

The document outlines exercises for importing and exporting data in MongoDB using a 'students.json' file. It includes tasks for importing data into a 'college' database, querying student information, exporting the collection, and modifying the data for re-import. Specific operations include displaying all students, filtering by department and marks, counting records, and updating the collection with new entries.

Uploaded by

Surya Alakanti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MongoDB Import/Export Exercises

1. Import Task

- Use the '[Link]' file and import it into a MongoDB database named 'college'.

- Collection name should be 'students'.

2. Query Tasks

- Display all students.

- Find students from the CSE department.

- Find students with marks greater than 80.

- Count how many students are in the database.

3. Export Task

- Export the 'students' collection into a file named 'students_backup.json'.

4. Modify and Re-import

- Edit the JSON file and add 2 new student records.

- Re-import with --drop option to replace old data.

You might also like