This kind of document are not accepted by Mongodb:
{'.':1}
if encode and decode by hand that's a pain. Any thoughts?
The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API.
A collection cannot have more than 64 indexes. The length of the index name cannot be longer than 125 characters. A compound index can have maximum 31 fields indexed.
All documents in a MongoDB collection have a primary key dubbed _id . This field is automatically assigned to a document upon insert, so there's rarely a need to provide it.
Key value databases, also known as key value stores, are database types where data is stored in a “key-value” format and optimized for reading and writing that data. The data is fetched by a unique key or a number of unique keys to retrieve the associated value with each key.
The Naming Restrictions on database, collection, and field names have practical purposes. They try to ensure queries are unambiguous and that valid filenames can be created.
For example:
MongoDB uses dot notation to access elements of an array or subdocument.
MongoDB uses the dollar sign ($) to represent operators (eg. $inc
).
Database names correspond to files created in the operating system, and there are reserved characters for path separators and wildcards.
The obvious workaround (which is also suggested in the MongoDB manual) is to use a different character. For example, the Unicode full width equivalents of $
and .
will display similarly but are not reserved:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With