-1
{
  "_id" : "648290899",
  "First_Name" : "Daniel",
  "Last_Name" : "Wu",
  "Gender" : "male",
  "Birthday" : "13/10/1978",
  "Email" : "dgozali@binacitra.com",
  "Bookmark" : ["mal-taman-anggrek__-6.18_106.79"],
  "Token" : "",
  "LikeOrDislike" : {
    "mal-taman-anggrek__-6.18_106.79" : 1,
    "bebek-goreng-h.-slamet__-6.20_106.77" : 1,
    "mcdonald's__-6.31_106.86" : 1,
    "pasar-rebo__-6.31_106.87" : 0
  },
  "Nearby" : [],
  "History" : [{
      "1355915008" : {
        "day" : "December 19, 2012, 6:03 pm",
        "LikeOrDislike" : {
          "mal-taman-anggrek__-6.18_106.79" : 1
        }
      }
    }, {
      "1355915015" : {
        "day" : "December 19, 2012, 6:03 pm",
        "Bookmark" : {
          "add" : ["mal-taman-anggrek__-6.18_106.79"]
        }
      }
    }, {
      "1355920137" : {
        "day" : "December 19, 2012, 7:28 pm",
        "LikeOrDislike" : {
          "bebek-goreng-h.-slamet__-6.20_106.77" : 1
        }
      }
    }, {
      "1355920233" : {
        "day" : "December 19, 2012, 7:30 pm",
        "LikeOrDislike" : {
          "mcdonald's__-6.31_106.86" : 1
        }
      }
    }, {
      "1355920441" : {
        "day" : "December 19, 2012, 7:34 pm",
        "LikeOrDislike" : {
          "pasar-rebo__-6.31_106.87" : 0
        }
      }
    }],
  "ImageProfile" : "http://graph.facebook.com/648290899/picture/?type=large"
}

我收到投诉说 pasar-rebo__-6.31_106.87 包含一个点。好的,它包含一个点。所以?

4

1 回答 1

4

字段名称不能包含点(即 .)、美元符号(即 $)或空字符。

来源:MongoDB 官方文档

原因是 Mongo 允许 javascript 样式的点表示法访问子集合。此外,点用作嵌入文档的分隔符,如此处所述

于 2012-12-20T03:51:31.790 回答