0
我很难找到使用mongo引擎删除嵌入式文档中的列表项的方法。从嵌入式文档中删除列表项MongoEngine
文档结构:
{
"_id" : "id",
"user" : ObjectId("xxxxxxx"),
"invoice" : false,
"coupon" : ObjectId("xxxxxxx"),
"date" : ISODate("2017-03-31T11:32:57.467Z"),
"orders" : [
{
"products" : [
ObjectId("xxxxxxx")
]
}
],
"shipping_address" : {
},
}
采用这种结构,我想达到的目标,是要删除的产品列表中订单内嵌入文档里面的ID。
有什么想法?任何帮助将非常感激
你怎么能指望的输出看? – GiantsLoveDeathMetal
空的产品清单{orders:[{products:[]}]} –