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

  • Learn MongoDB 4.x
  • Doug Bierer
  • 361字
  • 2021-06-11 18:21:32

Summary

In this chapter, you learned how to get into the mongo shell using a set of command-line options. You also learned how to use the .mongorc.js file to customize the shell. You learned how to perform basic database operations, such as conducting queries, and inserting, updating, and deleting documents.  You learned the basics of how to construct a query filter using query operators, and how to control the output by creating a projection. You also learned that the same filter created for a query can also be applied to update and delete operations. In the process of learning about performing queries, you were shown various examples of common ad hoc reports required by management.

You now know that there is a set of db.collection.XXX shell methods to perform operations on single documents, including findOne(), insertOne(), updateOne(), replaceOne(), and deleteOne(). There is a parallel set of db.collection.XXX shell methods that operate on one or more documents, including find(), insertMany(), updateMany(), and deleteMany(). You can use the xxxOne() set of methods to ensure only a single document is affected, which might be useful when performing critical updates. You also learned how these tools can be used to spot irregularities in the data, and how to make adjustments.

You then learned how to perform backup and restore using the mongodump and mongorestore tools. You learned about the various command-line switches available for these utilities and were presented with a number of points to consider in the interest of maintaining data integrity, especially when operating upon servers in a replica set. Finally, you were given an overview and some practical techniques on how to monitor database performance. As you learned, the two major methods are db.collection.stats() and db.serverStatus(). In addition to a summary of the major statistics available to monitor database operations, you also learned about which parameters to look to that might indicate impaired database performance.

In the next section of the book, you will learn how to build a dynamic database-driven web application using Python, based upon MongoDB. The next chapter will address database design for a typical small enterprise, Sweets Complete, Inc., a fictitious company offering confections for sale online.

主站蜘蛛池模板: 滁州市| 剑河县| 彩票| 通道| 蒙自县| 临桂县| 绥中县| 柞水县| 乐清市| 柯坪县| 璧山县| 翁牛特旗| 贵州省| 城固县| 彭阳县| 交城县| 静安区| 邓州市| 齐河县| 兴海县| 盐山县| 乌兰浩特市| 乌什县| 酉阳| 巴林左旗| 南投县| 大名县| 虎林市| 泰兴市| 遵化市| 彩票| 南木林县| 邮箱| 扶沟县| 治多县| 南昌县| 杭锦后旗| 芒康县| 泗水县| 锡林郭勒盟| 定日县|