MongoDB文档学习笔记(持续更新中)

来源:互联网 时间:1970-01-01


MongoDB will not permanently create a database until you insert data into that database. 


MongoDB will create a collection implicitly upon its first use. You do not need to create a collection before inserting data. Furthermore, because MongoDB uses dynamic schemas, you also need not specify the structure of your documents before inserting them into the collection.


When you access documents in a cursor using the array index notation, mongo first calls the cursor.toArray() method and loads into RAM all documents returned by the cursor. The index is then applied to the resulting array. This operation iterates the cursor completely and exhausts the cursor.
For very large result sets, mongo may run out of available memory.


MongoDB stores all documents in collections. A collection is a group of related documents that have a set of shared common indexes. Collections are analogous to a table in relational databases.


Data modification refers to operations that create, update, or delete data. In MongoDB, these operations modify the data of a single collection.


Read operations, or queries, retrieve data stored in the database. In MongoDB, queries select documents from a single collection.


Because the cursor is not isolated during its lifetime, intervening write operations on a document may result in a cursor that returns a document more than once if that document has changed. To handle this situation, see the information on snapshot mode.



相关阅读:
Top