meixiangnila 2012-12-11 14:38
浏览 1475
已采纳

mongodb特殊的key

mongodb中有的特殊字符不能作为key,比如".",请问一下大家一共有多少种特殊字符不能作为key?

  • 写回答

2条回答 默认 最新

  • jinnianshilongnian 2012-12-11 14:46
    关注

    请参考mongodb手册
    [url]http://docs.mongodb.org/manual/reference/limits/#Restrictions%20on%20Field%20Names[/url]

    Naming Restrictions
    Restrictions on Database Names
    The dot (i.e. .) character is not permissible in database names.

    Database names are case sensitive even if the underlying file system is case insensitive.

    Changed in version 2.2: For MongoDB instances running on Windows.

    In 2.2 the following characters are not permissible in database names:

    /. "*<>:|?
    See Restrictions on Database Names for Windows for more information.

    Restriction on Collection Names
    New in version 2.2.

    Collection names should begin with an underscore or a letter character, and cannot:

    contain the $.
    be an empty string (e.g. "").
    contain the null character.
    begin with the system. prefix. (Reserved for internal use.)
    See Are there any restrictions on the names of Collections? and Restrictions on Collection Names for more information.

    Restrictions on Field Names
    Field names cannot contain dots (i.e. .), dollar signs (i.e. $), or null characters. See Dollar Sign Operator Escaping for an alternate approach.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 onlyoffice编辑完后立即下载,下载的不是最新编辑的文档
  • ¥15 求caverdock使用教程
  • ¥15 Coze智能助手搭建过程中的问题请教
  • ¥15 12864只亮屏 不显示汉字
  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。