uncaught exception: SyntaxError: expected target, got identifier : @(shell):1:11
mongodb 插入数据报错
> db.iot-new.insert({"name":"haha"})
uncaught exception: SyntaxError: expected target, got identifier :
@(shell):1:11
>

数据库名有特殊符号:-
需要特殊处理
> use iot-new
switched to db iot-new
> db
iot-new
> db.getCollection("iot-new").insert({"name":"haha"})
WriteResult({ "nInserted" : 1 })

转载请记录来源!!!!
https://www.cnblogs.com/leihongnu/

浙公网安备 33010602011771号