In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
How to migrate part of the data in MongoDB, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
Scenario: migrate part of mongodb data from one CVM to another
Commands: mongoexport, mongoimport
$mongoexport-d db-c collection-o outfile-- type json/csv-f fields-h,-- the database address of the host remote connection, which connects to the local Mongo database by default. -- port remote connection database port. Default is 27017.muru.-- username connection remote database account. If the database has set authentication, you need to specify an account. -p,-- password corresponding to password connection remote database account-- authenticationDatabase authenticated database-d,-- db database name-c,-- collection collection name-- o,-- out exported file name-- type exported file format, default is JSON, optional CSV, JSON. -f,-- fields export fields, multiple fields are separated by commas. When the output format is CSV, you must specify the output field, which is supported by most relational databases in CSV. -Q,-- query query criteria-- skip skips a specified amount of data-- limit reads a specified number of data records-- sort sorts the data, specifying sorted fields, using 1 as ascending order-1 as descending order For example, sort ({key:1}) # derives the collection $mongoexport-- host 127.0.0.1-- port 27017-- username sa-- password sa-- authenticationDatabase game-- db test-- collection test-- type json-- out. / test.json# simplified method $mongoexport-d test-c tf_game-o. / test.json# imports the collection $mongoimport-- host 127.0.0.1-- port 27017-- username sa-- password sa-- authenticationDatabase game -- db test-- collection test-- file. / test.json, is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.