Node js add (key to map) by refering another ( map value) June 27, 2019 a = { "c" : "b" } console.log(a.a) f = { [a.c] : 5 -->[a.a] is the way to read the c key of a, else will throw err } console.log(f) --------------------------------- Output: b { b: 5 } => undefined Read more
append values to an array in elasticsearch June 24, 2019 PUT updateindextest/type1/1 { "counter" : 1, "roka" : ["red"] } PUT updateindextest/type1/2 { "counter" : 2, "roka" : ["sdf"] } POST /updateindextest/type1/_update_by_query?pretty { "script": { "inline": "ctx._source.roka.add(params.hits)", "params": {"hits": "pila"} }, "query": { "match_all": {} } } GET updateindextest/_search?pretty { "query": { "match_all": {} } } Read more
add new multiple fields to elasticsearch index June 23, 2019 Update by Query POST testindex_script_en/_update_by_query { "script": { "source" : "ctx._source.category_id = '111' ; ctx._source.category_value = 'category1'; ctx._source.slug = 'file_slug' ; ctx._source.tag_ids= [1,2,3] ; ctx._source.tag_values = ['t1','t2', 't2'] ; ctx._source.created_time = '2019-05-28 12:53:11' ; ctx._source.file = '/home/testdir' " } } Read more
add new field with mapping to elasticsearch new June 23, 2019 PUT updateindextest/_mapping/type1 { "properties": { "lola": { "type": "date" } } } refer last post for backgroup of index Read more
Add new field to the document in elasticsearch June 23, 2019 GET updateindextest/_search { "query": { "match_all": {} } } PUT updateindextest/type1/1 { "counter" : 1, "tags" : ["red"] } PUT updateindextest/type1/2 { "counter" : 2, "tags" : ["sdf"] } POST test/type1/all/_update { "doc" : { "name" : "new_name" } } Read more
export google credentials set path ubuntu June 07, 2019 export GOOGLE_APPLICATION_CREDENTIALS = "/home/user/Downloads/[FILE_NAME].json" Read more