Created
February 17, 2022 16:12
-
-
Save dimitardanailov/f7bd51f3a834e5dbcf9f4f9723e7b4b8 to your computer and use it in GitHub Desktop.
ElasticSearch: Delete an index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const {Client} = require('@elastic/elasticsearch') | |
const client = new Client({node: 'http://localhost:9200'}) | |
client.indices | |
.delete({ | |
index: 'audit-*', | |
}) | |
.then( | |
function (resp) { | |
console.log('Successful query!') | |
console.log(JSON.stringify(resp, null, 4)) | |
}, | |
function (err) { | |
console.trace(err.message) | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment