我在 Mongodb 中有一个如下所示的文档:
现在,我想转到基于特定“ _id”的文档,对于该文档,我想转到“计划”列表中的几个特定日期(不仅是一个日期,而是多个日期),我想更新状态为“BOOKED”。我浏览了这个链接,
How to apply update using Filtered positional operator with arrayFilters
but in MongoTemplate class, updateMultimethod does not take the updateOptionparameter. 有人可以帮忙吗
我出来。对于任何建议,我们将不胜感激。谢谢。
注意:我使用的是 spring-data 版本“2.0.3.RELEASE”,MongoDB 驱动程序版本是 v3.6.4。
下面是一份文件:
{
"_id": "x1",
"timeZone": "America/Los_Angeles",
"schedule": [
{
"Date": "2018-07-10T00:00:00.000Z",
"status": "AVAILABLE"
},
{
"Date": "2018-07-10T00:30:00.000Z",
"status": "AVAILABLE"
},
{
"Date": "2018-07-10T08:00:00.000Z",
"status": "AVAILABLE"
}
],
"_class": "com.scheduler.persistance.model.Calendar"
}
Run Code Online (Sandbox Code Playgroud)