mongodb 语法错误:意外标记非法。请帮我插入语法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27087773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 20:13:18 来源:igfitidea点击:
SyntaxError: Unexpected token ILLEGAL. Please help me insert syntax
提问by Hikaru Shindo
Here is my command
这是我的命令
db.tasks.insert({id : “0”, title : "task01”, description : "description", status : "1", assignorId : "7", assigneeId : “8", createdDate : “", startedDate : “", targetDate : “", completeDate : “", closedDate : “"})
MongoDB told my the syntax has an error.
What did I do wrong?
MongoDB 告诉我语法有错误。
我做错了什么?
回答by Scimonster
You're using curly quotes. Only plain quotes work:
您正在使用卷曲引号。只有简单的引号有效:
db.tasks.insert({id : "0", title : "task01", description : "description", status : "1", assignorId : "7", assigneeId : "8", createdDate : "", startedDate : "", targetDate : "", completeDate : "", closedDate : ""})