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

  • Mastering MongoDB 3.x
  • Alex Giamas
  • 204字
  • 2021-08-20 10:10:55

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.

主站蜘蛛池模板: 吉木萨尔县| 高陵县| 通州区| 杂多县| 略阳县| 兴海县| 务川| 昌宁县| 西峡县| 鹤山市| 会昌县| 巴彦淖尔市| 西青区| 壤塘县| 正阳县| 东平县| 西城区| 正安县| 五莲县| 尚义县| 罗定市| 扎鲁特旗| 岚皋县| 榕江县| 闻喜县| 周至县| 河东区| 乌兰浩特市| 图木舒克市| 宜章县| 咸阳市| 曲阳县| 榆树市| 安丘市| 京山县| 灵川县| 东源县| 石渠县| 阜新市| 大田县| 南通市|