官术网_书友最值得收藏!

Administration

Using MongoDB should most of the time feel and be transparent to the developer. Since there are no schemas, there is no need for migrations and generally developers find themselves spending less time on administrative tasks in the database world.

That being said, there are several tasks that an experienced MongoDB developer or architect can perform to keep MongoDB up to speed and performing as well as it can.

At the process level, there is the shutDown command to shut down the MongoDB server.

At the database level we have the following:

  • dropDatabase
  • listCollections
  • copyDB or clone to clone a remote database locally
  • repairDatabase when our database is not in a consistent state due to an unclean shutdown

Whereas at the collection level there are the following:

  • drop to drop a collection
  • create to create a collection
  • renameCollection to rename a collection
  • cloneCollection to clone a remote collection to our local DB
  • cloneCollectionAsCapped to clone a collection into a new capped collection
  • convertToCapped to convert a collection to a capped one

At the index level we can use the following:

  • createIndexes
  • listIndexes
  • dropIndexes
  • reIndex

We will also go through a few other commands that are more important from an administration standpoint.

主站蜘蛛池模板: 凌海市| 乐安县| 朝阳县| 宝鸡市| 永康市| 周至县| 沐川县| 元江| 奉化市| 赣州市| 邻水| 许昌县| 专栏| 称多县| 乐山市| 宣城市| 潮安县| 郎溪县| 平南县| 呼伦贝尔市| 海城市| 宜都市| 景德镇市| 张掖市| 柘荣县| 彰化市| 泗阳县| 衢州市| 辽中县| 和硕县| 萨嘎县| 瑞安市| 苏尼特右旗| 莱阳市| 上饶县| 三原县| 攀枝花市| 宜川县| 达拉特旗| 佛冈县| 山西省|