Support searching for any overlapping value(s) in arrays - Contains any

Description

Current situation or problem: The only operator currently supported for arrays is 'CONTAINS / NOT CONTAINS,' which limits the user to only providing a single value to query against an arrays. This will enable users to find matching records where any of the multiple input values match any values in the array.

In scope:

  • Building a FQL query that returns results if a database array field contains any of the values in the user-provided array

  • Building a FQL query that returns results if a database array field does not contain any of the values in the user-provided array

  • Adding or modifying an operator to support overlapping arrays

Scenario 1: contains any of the values
Given: The following records have these values for Field 1 (array)
         Record A: IA, NY, CA
         Record B: NY
         Record C: CA, FL
When: the following query is executed: Field 1 includes [IA, NY] (exact syntax TBD)
Then: Records A and B are returned; Record C is not returned

Scenario 2: not contain any of the values
Given: The following records have these values for Field 1 (array)
         Record A: IA, NY, CA
         Record B: NY
         Record C: CA, FL, IA
When: the following query is executed: Field 1 does not include [IA, CA, NY] (exact syntax TBD)
Then: No records are returned

 

Questions/notes:

Requirements:

  1. Includes any* operator is available for array fields

  2. Not includes any* operator is available for array fields

  3. Karate tests are created and passing

Environment

None

Potential Workaround

None

Attachments

2

Checklist

hide

TestRail: Results

Activity

Show:

Emma_HaroyanMarch 15, 2024 at 7:30 AM

Hey this is only BE ticket. You can close it based on the screenshots I’ve attached below.

Emma_HaroyanMarch 13, 2024 at 7:45 PM

Tested on Rancher using the APIs.

Scenario 1: contains any of the values

Scenario 2: not contain any of the values

Works as expected

Bobby SharpMarch 13, 2024 at 12:28 PM

Hey , we decided to hide arrays in the UI but still provide support for them in the BE, so this ticket is valid for the BE only. It can still be tested with APIs though.

Emma_HaroyanMarch 13, 2024 at 6:23 AM

hey is this ticket valid? we decided to hide the array type fields.

Bobby SharpMarch 6, 2024 at 1:38 PM

This ticket is BE only and is available in snapshot. It can be tested by POSTing a query with the $contains_any/$not_contains_any operator and checking the results. These operators only work for array datatypes. $contains_any should return all records where the specified array field contains any of the user-provided values. $not_contains_any should return all records where the array field does NOT contain any of the user-provided values. Here’s an example of a query with a $contains_any operator:

Any record returned by the above query should have IA or NY in its user_regions array (or both).

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Corsair

Fix versions

Release

Quesnelia (R1 2024)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 25, 2024 at 10:10 PM
Updated October 23, 2024 at 2:00 PM
Resolved March 15, 2024 at 9:37 PM
TestRail: Cases
TestRail: Runs