3
比方说,我们有这样的文档集合:如何增加MongoDB中由索引引用的数组元素?
{
_id : "some id",
items: [
{item: "item A", count: 5},
{item: "item B", count: 3},
{item: "item C", count: 9}
]
}
如何通过增加第三(或任何其他指标值)中的项目数组元素的值1?
而且我想通过匹配值而不是像这个question那样匹配值,而是通过索引来引用。
你为什么要问这个问题,如果你已经知道答案?也可能重复http://stackoverflow.com/questions/16037788/mongodb-increment-value-inside-nested-array –
@SarathNair它是完全没关系。尽管它是重复的。 http://meta.stackoverflow.com/questions/290038/answer-your-own-question-qa-style – Idos
@Idos“所以我想出了一个问题,做了我的研究,发现没有任何帮助”这个问题已经在SO –