Created
March 15, 2017 12:46
-
-
Save frenchbread/4bc19cdbb8fe3f04e085ea5715a13d6e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
getAPIKeys () { | |
const esClient = new ElasticSearch.Client({ host: 'http://nightly.apinf.io:14002' }); | |
const params = { | |
size: 10, | |
body: { | |
sort: [ | |
{ | |
request_at: { | |
order: 'desc', | |
}, | |
}, | |
], | |
}, | |
}; | |
esClient.search(params).then((res) => { | |
console.log('Results:'); | |
console.log(res.hits.hits); | |
}, (err) => { | |
// Throw an error | |
throw new Meteor.Error(err.message); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment