Skip to content

Instantly share code, notes, and snippets.

@frenchbread
Created March 15, 2017 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frenchbread/4bc19cdbb8fe3f04e085ea5715a13d6e to your computer and use it in GitHub Desktop.
Save frenchbread/4bc19cdbb8fe3f04e085ea5715a13d6e to your computer and use it in GitHub Desktop.
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