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

Mongo simple operation

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Use admin # enter the database admin

Db.addUser ('name','pwd') # add or modify a user's password

Db.system.users.find () # View user list

Db.auth ('name','pwd') # user authentication

Db.removeUser ('name') # Delete a user

Show users # View all users

Show dbs # View all databases

Show collections # View all collection

Db.printCollectionStats () # View the status of each collection

Db.printReplicationInfo () # View the status of master-slave replication

Db.repairDatabase () # repair the database

Db.setProfilingLevel (1) # set record profiling,0=off 1=slow 2=all

Show profile # View profiling

Db.copyDatabase ('mail_addr','mail_addr_tmp') # copy the database

Db.mail_addr.drop () # Delete collection

Db.dropDatabase () # Delete the current database

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