2014-11-23 31 views
9

這裏是我的命令SyntaxError:意外標記非法。請幫我插語法

db.tasks.insert({id : 「0」, title : "task01」, description : "description", status : "1", assignorId : "7", assigneeId : 「8", createdDate : 「", startedDate : 「", targetDate : 「", completeDate : 「", closedDate : 「"}) 

的MongoDB告訴我的語法有錯誤。
我做錯了什麼?

回答

28

您正在使用捲曲報價。只有簡單的引號工作:

db.tasks.insert({id : "0", title : "task01", description : "description", status : "1", assignorId : "7", assigneeId : "8", createdDate : "", startedDate : "", targetDate : "", completeDate : "", closedDate : ""}) 
+3

謝謝。我從我的Evernote中複製並粘貼,並遇到這個問題 - 使我瘋狂。 – 2015-06-26 01:53:51

+0

evernote對我做了同樣的事情! +1在答案 – MyNameIsAVerb 2015-11-29 16:15:13

+0

筆記在我的Mac導致相同的問題! – 2016-10-12 02:51:29

相關問題