[LIBFQMQUER-2] Add CONTAINS operator to handle arrays Created: 18/Sep/23  Updated: 27/Sep/23  Resolved: 27/Sep/23

Status: Closed
Project: lib-fqm-query-processor
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: Bobby Sharp Assignee: Kathleen Moore
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: PNG File API3.png     PNG File Department.png     PNG File Screen Shot 2023-09-21 at 1.25.55 PM.png    
Sprint: Corsair Sprint 174, Corsair Sprint 175
Story Points: 0.5
Development Team: Corsair
Release: Poppy (R2 2023)
RCA Group: TBD

 Description   

With the introduction of array datatypes, we need to create a new operator to handle queries on array fields. When this story is complete, a user should be able to create a query for array fields with a CONTAINS operator. This operator will return any results for which an array field contains the provided value.

 

For example, the query

"{\"department_ids\":{\"$contains\": \"fe16a756-36d0-4655-868e-f10cc1f2ec48\"}}"

should return all users whose department_ids array contains the value "fe16a756-36d0-4655-868e-f10cc1f2ec48".



 Comments   
Comment by Bobby Sharp [ 20/Sep/23 ]

Emma_Haroyan This is currently BE only. It can be tested in the corsair-frm environment by making a POST query or POST list request with the above query. Only users whose department_ids array contains the specified value should be returned for the list.

Comment by Kriti Jain [ 21/Sep/23 ]

Bobby Sharp, this is working as expected

Comment by Emma_Haroyan [ 24/Sep/23 ]

Query -   "fqlQuery": "{\"department_ids\":{\"$contains\": \"f08d1eec-1318-4d08-9727-d5f8057318df\"}}"
Department id = f08d1eec-1318-4d08-9727-d5f8057318df , department name = "Social Welfar".

Here is the list - https://corsair-frm.int.aws.folio.org/lists/list/9c6c6a3e-7cd5-4242-86bf-e8d9feacf66d
Which has  "userFriendlyQuery": "department_names contains Social Welfare"  query and according to that 3 records

Works as expected.
Kathleen Moore Please approve

Generated at Thu Feb 08 22:32:10 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.