Created
October 14, 2015 01:35
-
-
Save sahas-/bc29e621e61e3cf0baf3 to your computer and use it in GitHub Desktop.
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
var es = require('elasticsearch'); | |
module ejs{ | |
export class Ops{ | |
update(){ | |
let action = {'update': {'_id': 'AVBjrkfgjt6ZxwHlJ1w5'}}; | |
let data = {"doc":{"more data":{"dob":1981,"place":"TN"}}}; | |
let _client = new es.Client({host:"http://192.168.99.111:9200"}); | |
_client.bulk({ | |
index:'elasticsearch', | |
type:'hack', | |
field:'_source', | |
body:JSON.stringify(action)+'\n'+JSON.stringify(data) | |
}).then((res)=>{ | |
console.log(res); | |
},(error) =>{ | |
console.log(error); | |
}); | |
} | |
} | |
} | |
var _ops = new ejs.Ops(); | |
_ops.update(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment