You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2022/07/12 16:14:39 UTC

[GitHub] [unomi] sergehuber commented on a diff in pull request #461: Unomi 603 migration profiles

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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org