Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以告诉我从同一文档中的数组中设置字段值的语法吗?也就是说,给定:
{ "MyArray" : [ 1, 2, 3 ] }
我需要将其更新为
{ "MyArray" : [ 1, 2, 3 ], "NewValue" : 3 }
MongoDBupdate不支持将字段设置为来自同一文档的值。你只能传入常量。
update