gpt4 book ai didi

mongodb - MongoShell : SyntaxError: missing : after property id @(shell):1:137 mongo

转载 作者:行者123 更新时间:2023-12-03 08:08:07 27 4
gpt4 key购买 nike

试图从Mac终端插入mongoshell:

    db.recipe.insert({ "_Title": "newname", "_Ingredients": 
"newingredients" , "_Instructions": "newinstructions" ,"
_Time":1,"_Category": "newcategory", "_Author": "newauthor" ,
"_RecipeVersion": 1})

产生错误:

SyntaxError: missing : after property id @(shell):1:137



不确定我在这里缺少什么...

最佳答案

您的JSON对象中似乎存在不寻常的间距-我只是在代码编辑器中对此进行了格式化,清理了间距并使其工作:

db.recipe.insert({ 
"_Title": "newname",
"_Ingredients": "newingredients" ,
"_Instructions": "newinstructions" ,
"_Time":1,
"_Category": "newcategory",
"_Author": "newauthor",
"_RecipeVersion": 1
})

关于mongodb - MongoShell : SyntaxError: missing : after property id @(shell):1:137 mongo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44760556/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com