Any work with the Mongodb key cannot contain "." or "$"?

This kind of document is not accepted by Mongodb:

{'.':1}

if you encode and decode manually, that pain. Any thoughts?

+5
source share
1 answer

Name restrictions in database, collection, and field names are for practical purposes. They try to ensure that queries are unambiguous and valid file names can be created.

For instance:

  • MongoDB uses dot notation to access elements of an array or subdocument.

  • MongoDB uses a dollar sign ($) to represent operators (e.g., $inc).

  • , , .

( MongoDB) . , Unicode $ . , :

  • U + FF04 (.. "$" )
  • U + FF0E (.. "." )
+5

All Articles