Analogous to item. A single entry in a collection
. A JSON object.
- cannot start with a dollar sign > $ (as this specifies a field path or an operator)
- cannot contain a dot > .
- cannot have null
- maximum size: 16mb
A name-value pair in a document. (Analogous to key-value).
A collection of documents
. In my head this is what I think of as a database
.
Basically a collection (container) of collections
. Every database
has its own file set.
Data structures that store small parts of the collection's data that you set so that Mongo can search without scanning every single document in that collection.
// $lt is the query criteria
// users is the collection
db.users.find( { score: { "$lt": 30 } } ).sort( { score: -1 } );
Here
V
+---------------+----------------+---------------+---------------+----------------+
| { | { | { | { | { |
| score: 1 | score: 15 | score: 30 | score: 35 | score: 100 |
| } | } | } | } | } |
+---------------+----------------+---------------+---------------+----------------+
12-byte id generated automatically that displays in hexadecimal.
Distributing a mongo server, to individual shards