update_by_query

The function update_by_query(collection_name, body) updatesl documents according to the query conditions

Input-

  • collection_name – Specifies the Collection with the documents to delete

  • body– The query that specifies the conditions for documents to be updated

Example-

hyperspace_client.delete_by_query(collection_name, 
                            body = {"query": {
                                        "bool": {
                                            "must": {
                                                    "term": {
                                                        "name": "John"
                                                    },
                                                }
                                        },
                                    "script": "ctx._source.name = 'Bob'",
                                    })

Last updated