MongoDB; Uncaught exception: SyntaxError: missing } after property list :

MongoDB; Uncaught exception: SyntaxError: missing } after property list :

目前正在试用非关系数据库和 MongoDB,我正在向我的数据库添加一个电影列表。但是,每次我添加电影时都会出现此错误: 未捕获的异常:SyntaxError:在 属性 列表之后缺少 }: @(shell):6:309

我不明白我不知道,因为我有正确数量的“}”。这是我正在尝试做但出现错误的示例:

var movie2 = {
… Title: “Inception”,
… Description: “A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O., but his tragic past may doom the project and his team to disaster.”,
… Genre: {
… Name: “Sci-Fi”,
… Description: “Science fiction (sometimes shortened to sci-fi or SF) is a genre of speculative fiction which typically deals with imaginative and futuristic concepts such as advanced science and technology, space exploration, time travel, parallel universes, and extraterrestrial life. It has been called the “literature of ideas”, and it often explores the potential consequences of scientific, social, and technological innovations.”
… },
… Director: {
… Name: “Christopher Nolan”,
… Bio: “Best known for his cerebral, often nonlinear, storytelling, acclaimed writer-director.”,
… Birth: “1970-07-30”
… },
… ImagePath: “Inception (2010)”,
… Featured: true
… }
uncaught exception: SyntaxError: missing } after property list :
@(shell):6:309

我在本地试过了,我认为你有一些对我不起作用的东西。我建议逐行尝试,看看哪些有效,哪些导致失败。

  1. 显然必须用某种格式的空格替换 ...
  2. 我需要将“和”替换为“。当我没有替换时,即使只有标题,Mongo playground 也会抱怨。https://mongoplayground.net/p/EwYYx11rPyS
  3. 完成替换后,我不得不在围绕“思想文学”的文本中转义您想要的 " 字符。

这对我来说效果很好:https://mongoplayground.net/p/hhKpK35Cut7

当您忘记冒号或逗号或者混合引号时,通常会出现此错误。

我认为 “literature of ideas” 上的引号导致了这一点。可以改成单引号吗?