Project

General

Profile

Idea #15781

Updated by Tom Morris about 5 years ago

h2. Backend 

 https://www.postgresql.org/docs/9.5/functions-json.html 

 <pre> 
 arvados_development=# select '{"a":["foo","bar"]}'::jsonb @> '{"a":["bar"]}'::jsonb; 
  ?column?  
 ---------- 
  t 
 </pre> 

 So jsonb subset match works if you know the key and are looking for an exact match on the value. 

 It looks like an Arvados arvados filter of @[["properties.a", "=", ["bar"]]@ might already work by since it uses @@>@ in the implementation.    Although that's arguably a bug since the expectation is to get an exact match.    Instead we'll introduce a new operator Using @[["properties.a", "contains", "bar"]@. "in", ["bar"]]@ makes more sense, and also looks like it would work. 

 h2. Frontend UI 

 For editing, rather than overwriting a tag:value pair as is done currently when the tag is specified multiple times, add the new tag:value pair to the list. When writing to the backend, merge the values into an array which becomes value that's written into the properties. Arrays are only used when there are multiple values. 

 For searching the implementation will use the new @contains@ operator internally, but continue to use the "has" notation externally. ???

Back