How to update document with field mapping Object(multi=True)
,
when a document can have both single (dictionary) and multiple values (list of dictionaries).
Example of documents in the same index:
A single value in items
:
{
"title": "Some title",
"items": {
"id": 123,
"key": "foo"
}
}
Multiple values in items
:
{
"title": "Some title",
"items": [{
"id": 456,
"key": "foo"
}, {
"id": 789,
"key": "bar"
}]
}