[LIBFQMQUER-3] Add NOT CONTAINS operator for arrays Created: 18/Sep/23  Updated: 18/Oct/23  Resolved: 22/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: Bobby Sharp
Resolution: Done Votes: 0
Labels: back-end
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: PNG File List100.png     PNG File Screenshot 2023-09-22 at 8.31.53 AM.png    
Sprint: Corsair Sprint 174
Story Points: 1
Development Team: Corsair
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 NOT CONTAINS operator. This operator will return any results for which an array field does not contain the provided value.

 

For example, the query

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

should return all users whose department_ids array does not contain 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 DOES NOT CONTAIN the specified value should be returned for the list.

Comment by Emma_Haroyan [ 22/Sep/23 ]

Tested on corsair-frm environment via Postman.

In the task description, department id is fe16a756-36d0-4655-868e-f10cc1f2ec48, which's name is 'Witchcraft'.

And we should filter the users, that don't have 'Witchcraft' department name.

I used the following user https://corsair-frm.int.aws.folio.org/users/preview/3893fbde-bf28-4292-80cf-f60ac1f30e11?query=Emma2020&sort=name . And my user has:  department name -"French" and the department id = "3e9cb6cd-ce0b-4fe3-ace5-36ac92d3aa2f".

When I created  query (you cab do GET https://okapi-corsair-frm.int.aws.folio.org/query/dfc5a608-da83-41a5-a18a-5c3d726be479 ) and created a new list https://corsair-frm.int.aws.folio.org/lists/list/b2fd2c51-73e3-479a-bdd7-496c1cb0f41e , I expected to see at least my user there, but I got completely empty department names and ids.

Bobby Sharp 

 

Comment by Bobby Sharp [ 22/Sep/23 ]

Hi Emma_Haroyan I checked the list and your user does actually show up on the list with all the correct information, it's just very very far down in the results column. If you use a size of 1000 and an offset of 20000, you should be able to see your user in the results, as shown in the screenshot.

Comment by Emma_Haroyan [ 22/Sep/23 ]

Hi Bobby Sharp thanks. Now I see

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