Home > database >  Directing how to export more collections of elements
Directing how to export more collections of elements

Time:09-26

There are multiple sets in the mongo, I can only use mongoexport a set a set of export,
How can the batch export, collection of field is the same,

Mongo export TXT text code:
Mongoexport -h 127.0.0.1 - port 27017 - username the username, password password - collection accounts - f the account, the balance - out 1. TXT - db dbname

The collection list:


CodePudding user response:

Mongodump not?

CodePudding user response:

reference 1st floor rucypli response:
mongodump not?


But I want to TXT file, mongodump can only export DMP file,

CodePudding user response:

Mosaic this script on the shell file executed directly inside the shell
Mongoexport - db test - collection traffic1 -- out traffic. Json1
Mongoexport - db test - collection traffic2 -- out traffic. Json2
Mongoexport - db test - collection traffic3 -- out traffic. Json3

CodePudding user response:

It is ok to use pymongo

CodePudding user response:

I'm in a mongo on BBS seen a method, the query results can be exported to the text, you can refer to:

http://forum.foxera.com/mongodb/topic/145/mongodb%E8%BF%90%E7%BB%B4-%E5%AF%BC%E5%87%BA%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%E5%88%B0%E6%96%87%E6%9C%AC%E4%B8%AD? UN=Jerry

CodePudding user response:

Blogger has solved? I need with the Spark is read from a database of all the collections, table structure is the same as the field,
  • Related