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

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.

主站蜘蛛池模板: 河南省| 柞水县| 南川市| 永德县| 额敏县| 福海县| 吉安县| 青阳县| 张北县| 房产| 保康县| 肃南| 舞阳县| 宁河县| 荣成市| 鄂托克旗| 宜川县| 巴彦淖尔市| 集安市| 开阳县| 宁河县| 明水县| 平江县| 弥渡县| 三都| 澳门| 长岛县| 独山县| 博客| 武平县| 南通市| 柳河县| 古浪县| 六枝特区| 隆安县| 莱阳市| 湘西| 万山特区| 舒城县| 裕民县| 西华县|