MongoDB 集合更新尝试出现 "identifier starts immediately after numeric literal" 错误

MongoDB collection update attempt gives "identifier starts immediately after numeric literal" error

我有一个名为 "posts" 的 MongoDB 集合,其中一个 post 对象如下所示:

{
    "_id" : ObjectId("5eb45c2738ae2549000ddb1b"),
    "category" : ObjectId("5e99e61b3b7733f59053e49a"),
    "title" : "Dolorem et inventore aspernatur vel nam.",
    "full_text" : "Id qui iusto. Aspernatur et fugit ut. Sit laboriosam velit. Est magnam aut ipsum corrupti nihil dolor. Similique repudiandae vero deserunt. Dicta voluptate nesciunt.",
    "short_description" : "Aut sint voluptatem et. Vel repellat error eveniet nesciunt perspiciatis et dolor.",
    "updated_at" : "1989-11-02T23:00:00.000Z",
    "created_at" : "1981-11-21T23:00:00.000Z"
}

我想将早于 2014-07-19 的年份创建的所有 post 的 full_text 字段更新为某个文本(所有 post符合条件)。

为此我做了:

db.posts.updateMany({ "created_at": { $lt: 2014-07-19T22:00:00.000Z }},{ $set: {full_text: "<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et dolor at eros tristique tempor at quis erat. Fusce id ante quis lectus blandit porta. Sed erat justo, bibendum blandit sodales vitae, dictum et massa. Integer eget finibus tortor.</p>"}});

没有更新发生,我从 CMD 收到 SyntaxError: identifier starts immediately after numeric literal 错误消息。

我做错了什么?

这是javascript错误

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Identifier_after_number

尝试像这样将您的日期用作字符串:

"2014-07-19T22:00:00.000Z"