最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
MongoDB fixed set (Capped Collections) is a collection with excellent performance and fixed size. For a fixed size, we can imagine that it is like a circular queue. When the set space is used up, the inserted element will cover the original header element! We create a fixed collection through createCollection, and the capped option is set to true: You can also specify the number of documents, plus the max:1000 attribute: Determine whether the set is a fixed set: If you need to convert an existing collection to a fixed collection, you can use the following command: The above code converts our existing posts collection into a fixed collection. Fixed collection documents are stored in insertion order, and queries are returned in insertion order by default, or you can use $natural to adjust the return order. You can insert and update, but the update cannot exceed the size of the collection, otherwise the update fails and deletion is not allowed, but you can call drop () to delete all rows in the collection, but you need to explicitly rebuild the collection after drop. The maximum value of a cappped collection on a 32-bit machine is about 482.5m, which is limited only by the size of the system file on 64-bit. Attribute 1: inserting a fixed collection is extremely fast Attribute 2: query output in insertion order is extremely fast Attribute 3: the ability to eliminate the earliest data when inserting the latest data Usage 1: store log information Usage 2: cache a small number of documents 3.44.1. Create a fixed collection ¶
>db.createCollection("cappedLogCollection",{capped:true,size:10000})
>db.createCollection("cappedLogCollection",{capped:true,size:10000,max:1000})
>db.cappedLogCollection.isCapped()
>db.runCommand({"convertToCapped":"posts",size:10000})
3.44.2. Fixed set query ¶
>db.cappedLogCollection.find().sort({$natural:-1}) 3.44.3. The functional characteristics of fixed sets ¶
3.44.4. Fixed set attributes and usage ¶
Attribute ¶
Usage ¶