3
我有以下代碼,我試圖更新列表字段中的嵌入式文檔。Mongoengine更新嵌入式文檔
store = store_service.get_store_from_product_id(product_id)
got_product, idx = get_product_from_store(store, product_id)
product = Product()
product.pid = got_product.pid
product.display_name = display_name
product.description = description
product.rank = rank
product.price = price
product.categories = categories
product.properties = properties
store.catalog.products[idx] = product
print store.catalog.products[idx].__unicode__()
store.save()
當我打印出我的產品時,它具有正確的值,但是當我保存它時,它不會持續。沒有錯誤被拋出。任何想法,我可能做錯了什麼?