Cloud Stack Ninja

I want to initialize an empty array like this below. How can I do that ?

"hits": {
        "total": 1,
        "max_score": 1,
        "hits": [
            {
                "_index": "customers",
                "_type": "customer",
                "_id": "QOTzXMUcrnbsYyFKeouHnjlkjQB3",
                "_score": 1,
                "_source": {
                    "uid": "QOTzXMUcrnbsYyFKeouHnjlkjQB3",
                    "email": "george@gmail.com",
                    "favorites": [],  < ---- this is the problem
                    "history": [],
                    "settings": {},
                    "purchases ": [],
                    "created": 1507892081201,
                    "updated": 1507892081201
                }
            }
        ]
    }


Read more here: https://stackoverflow.com/questions/64400454/how-to-initialize-tags-array-list-in-elasticsearch-and-python

Content Attribution

This content was originally published by Ha Huy at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: