sergehuber commented on code in PR #461:
URL: https://github.com/apache/unomi/pull/461#discussion_r919160364


##########
tools/shell-commands/src/main/resources/requestBody/2.0.0/update_profile_interests.json:
##########
@@ -0,0 +1,4 @@
+{
+    "source": "List interests = new ArrayList(); 
if(ctx._source.properties.interests != null && 
!(ctx._source.properties.interests instanceof List)){ for (entry in 
ctx._source.properties.interests.entrySet()){ Map interest = new HashMap(); 
interest.put('key',entry.getKey()); interest.put('value', entry.getValue()); 
interests.add(interest);} ctx._source.properties.remove('interests'); 
ctx._source.properties.put('interests',interests);}",
+    "lang": "painless"
+}

Review Comment:
   Funny I had the exact same idea :) 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to