当mongo collection的名字当中存在特殊字符时,在shell中对改集合进行操作会报SyntaxError: identifier starts immediately after numeric literal的错误。

解决办法:getCollection函数将collection name转换一下即可

例:

order_cluster:PRIMARY> db.getCollection("order_2017-08").find().count()
12991689

有些工具已经对此做出相应处理,如:MongoChef

mongo collection name—SyntaxError: identifier starts immediately after numeric literal

注意选择value的数据类型

mongo collection name—SyntaxError: identifier starts immediately after numeric literal

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-21
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2021-05-06
相关资源
相似解决方案