【发布时间】:2018-11-15 08:05:33
【问题描述】:
我正在尝试运行这个 MongoDB 脚本:
db.test_collection.insert({
_id: ObjectId(7df78ad8902c),
title: ‘Mongo Db practice’,
description: ‘this class is about MongoDB’
})
并不断收到此错误:
SyntaxError: identifier starts immediately after numeric literal @(shell):1:42
我认为这与 _id 和 ObjectId(7df78ad8902c) 有关,因为当我输入 ObjectId("stringliteral") 时,错误消息会发生变化。
感谢任何帮助。
【问题讨论】:
标签: database mongodb syntax syntax-error