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

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.

主站蜘蛛池模板: 崇礼县| 万盛区| 中西区| 赫章县| 西和县| 皋兰县| 南部县| 合川市| 甘南县| 隆化县| 昌都县| 获嘉县| 桃江县| 宽甸| 合山市| 淮阳县| 榆树市| 仲巴县| 龙里县| 垦利县| 怀来县| 洪湖市| 平泉县| 勃利县| 邯郸县| 营山县| 景洪市| 瓦房店市| 长治县| 砀山县| 林州市| 岑溪市| 陇南市| 临潭县| 康乐县| 积石山| 富锦市| 沧州市| 西乌珠穆沁旗| 济南市| 桐城市|