delete_by_query

The functiondelete_by_query(collection_name, body) deletes all documents that match the query conditions

Input-

  • collection_name – Specifies the Collection with the documents to delete

  • body– The query that specifies the documents to delete

Example-

hyperspace_client.delete_by_query(collection_name, 
                            body = {"query": {
                                        "bool": {
                                            "must": {
                                                    "term": {
                                                        "department": "IT"
                                                    },
                                                }
                                        }
                                    })

Last updated