Add or update a new item into the nested objects

I have the next mapping :

"c_index": {
    "aliases": {},
    "mappings": {
        "an": {
            "properties": {
                "id": {
                    "type": "string"
                },
                "sm": {
                    "type": "nested",
                    "properties": {
                        "cr": {
                            "type": "nested",
                            "properties": {
                                "c": {
                                    "type": "string"
                                },
                                "e": {
                                    "type": "long"
                                },
                                "id": {
                                    "type": "string"
                                },
                                "s": {
                                    "type": "long"
                                }
                            }
                        },
                        "id": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }

I want to insert a new element 'sm' in a specific an (an with id =X), but I can not get all the other sm's that are already inside that an, because they are too bigs and is very difficult to deal with them. Is there any way to do this? if the sm already exists can I update it? I already tried to insert the new element and insert it, but it erases the others that I have. Thank you very much!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.