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

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.

主站蜘蛛池模板: 内丘县| 镇赉县| 岐山县| 原阳县| 永德县| 申扎县| 阳曲县| 永宁县| 清镇市| 沅陵县| 和龙市| 迁安市| 宾川县| 义乌市| 广丰县| 玉树县| 竹山县| 福海县| 扬中市| 石家庄市| 馆陶县| 凭祥市| 阿克苏市| 洪洞县| 涡阳县| 项城市| 宜川县| 长丰县| 张家港市| 漳平市| 辽宁省| 壤塘县| 个旧市| 保山市| 区。| 綦江县| 噶尔县| 丹寨县| 庆云县| 隆昌县| 吉林市|