【问题详细描述】
创建索引时报语法错误,操作如下:
> db.foo.bar.createIndex( "idx", { a.b: 1 } )
(shell):1 SyntaxError: missing : after property id
【解决办法】
用户在创建索引时索引key缺少了双引号:
实际输入:db.foo.bar.createIndex( "idx", { a.b:1 } )
正确输入:db.foo.bar.createIndex( "idx", { "a.b":1 } )
参考资料:http://doc.sequoiadb.com/cn/index-cat_id-1432190830-edition_id-0
【参考链接】
错误码
常见错误处理指南