# Get difference between 2 string arrays

**URL:** https://discuss.elastic.co/t/get-difference-between-2-string-arrays/96283
**Category:** Elasticsearch
**Created:** [August 8, 2017, 2:09pm UTC](https://discuss.elastic.co/t/get-difference-between-2-string-arrays/96283 "2017-08-08T14:09:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![olegb](https://avatars.discourse-cdn.com/v4/letter/o/bbce88/32.png) [@olegb](https://discuss.elastic.co/u/olegb)
#### Post date: [August 8, 2017, 2:09pm UTC](https://discuss.elastic.co/t/get-difference-between-2-string-arrays/96283/1 "2017-08-08T14:09:49Z")

</div>

Hi All,  
I've a documents contains an array fields names "my\_tag" and "unique\_id". I'd like to get differences between 2 unique\_ids with values like { "uid":1, my\_tag: ["va1","val2", "val10"]} and { "uid":2, my\_tag: ["va1","val20"]} with result  
udi:1 diff uid:2 = ["val2", "val10"]  
and  
udi:2 diff uid:1 = ["val20"]  
like set type in python

what is the way to do the difference

Thaks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 5, 2017, 2:12pm UTC](https://discuss.elastic.co/t/get-difference-between-2-string-arrays/96283/2 "2017-09-05T14:12:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
