mongoexport exports the data in the specified table to JSON format.
Use mongoexport to export data from a table:
mongoexport --host=<ip> --port=<port> --username=<user> --password=<password> --authenticationDatabase=admin --db=<database> --collection=<collection> --out=xxx.json
After execution, you will see the data in JSON format in the specified output file.
The exported JSON data can be imported to other instances or tables using the mongoimport tool.
Use mongoimport to import JSON data into a table:
mongoimport --host=<ip> --port=<port> --username=<user> --password=<password> --authenticationDatabase=admin --db=<database> --collection=<collection> xxx.json
After the import is complete, log in to the target instance and you can see that data has been successfully inserted into the corresponding library table.