curl -XPOST 'localhost:9200/twitter/_update_by_query?pretty' -H 'Content-Type: application/json' -d'
{
"script": {
"source": "ctx._source.message.add(params.message)",
"params": {
"message": "baz"
}
},
"query" : {
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
158b3d4cc373e6700a760aa94f33d031728408b9c0d3b9c382a274c9a7e8507c8798ac9b799ac09e5bc49b3ab21a1a411f0592e3f4cf425c02d5bbc5689e7b11 |
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
// https://www.geeksforgeeks.org/longest-subarray-sum-elements-atmost-k/ | |
function maxLength(arr, k) { | |
let sum = 0; | |
let cnt = 0; | |
let maxLength = 0; | |
const arrL = arr.length; | |
for (let i = 0; i < arrL; i++) { | |
sum += arr[i]; | |
if (k >= sum) { |
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
let CryptoJS = require("crypto-js"); | |
let message = '{"wifi":"wtf","password":"ABCDEFG1", "timestamp": "1234566"}'; | |
let password = '~NB8CcOL#J!H?|Yr'; | |
function decodeToString(string) { | |
return CryptoJS.enc.Base64.parse(string).toString(CryptoJS.enc.Utf8); | |
} |