Mongodb update with upsert fails

2019-09-05 04:46发布

Here is the statement which fails:

db.some_collection.update(query,modifier_set, upsert=True, safe=True)

modifier_set is of the form {"$inc":{...}, "$addToSet":{...}}

I get an OperationFailure error:

$ operator made object too large

Now, it's highly unlikely that my document it more that 16MB.

Any other possible reasons for such failure ?

1条回答
Luminary・发光体
2楼-- · 2019-09-05 05:03

It is actually a case of oversized document.
db.collection_name.stats() confirmed it.

查看更多
登录 后发表回答