Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[MongoDB] Common knowledge points

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Modify Primary Fragment

db.runCommand({"movePrimary":"db", to:"fragment id"});

2. Merge blocks (blocks need to be empty)

db.runCommand({"mergeChunks":"db.collection", bounds:[min_shardkey,max_shardkey]})

3. Get block size

db.runCommand({"dataSize":"db.collection","keyPattern":{shardkey:1}, min:{sharkey:min},max:{shardkey:max}})

4. Get segmentation policy

db.runCommand({splitVector: "db.collection", keyPattern: {sharkey:1}, maxChunkSizeBytes: 10008864})

5. repair the database

db.repairDatabase()

6. repair set

db.collection.runCommand("compact")

7. Copy database

db.copyDatabase("fromdb", "todb", "fromhost")

8. Backup the configuration server data before performing cluster maintenance operations

9. There should be one mongos process per application server

10. modifier keys: export data, modifier keys, then import data

11. Importing data before creating an index is more efficient than creating an index before importing data

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report