.hasSome Return missing records from Array

export function get_ukmsMaterialDescription(request) {
let options = {
“headers” : {
“content-Type” : “application/json”
}
};
let StringArray =
StringArray = request.path[ 0 ].split( “_” );
console.log(StringArray);
return wixData.query( “UKMS_Materials_V1” )
.hasSome( “assemblyRef” , StringArray)
.find()
.then((results) => {
if (results.items.length > 0 ) {
options.body = {
“items” : results.items
};
return ok(options);
}
});
}

Has anyone else had issues with .hasSome not returning all records from Array? The Array is correct and the applicable records exist. I have tried with numerous sizes of array and my only conclusion is that this function has a bug.

What’s the field type of “assemblyRef”? is it a string? an array? a multi-reference?

assemblyRef is a String. I know the hasSome is case sensitive but the values in the array StringArray are inherited from the another collection/table.

Can you post an example for the value in the database and an example for the StringArray value?

There are more than 28,500 entries in the collection. The table is for material components and assembly references which i am developing an API to access from CAD and Excel. The issue arose when i notice blank fields for descriptions in excel…see below

First of all, you should know that by default a query returns up to 50 results.
You can rise up the limit by adding .limit(1000) to the query. 1000 entries is the maximum. If you have more then 1000 results, you’ll need to loop over them.
I don’s see why the empty description should have any effect.

The Developer Log shows all the elements are being passed correctly into the Array…

Can you post an example of the StringArray value as well?

@jonatandor35 the testing undertaken so far have no encroached these limits so this is not the cause. I will add this to the procedure if proved viable.

@jonatandor35 this is shown in the jsonPayload image above.

my next option is to iterate through the Array and .contains(), which i’ve seen discussed on here.

@rowly77 So I don’t know why it isn’t working. Maybe you have some extra spaces in the collection values?

@jonatandor35 Checked all that…the items which are missing have been tested directly in an Array of 1 item. This worked with .hasSome. Therefore the error is not with the data but this the .hasSome function.

@rowly77 so I have no idea. What will happen if you query:
.hasSome(“assemblyRef”, StringArray .join(“,”) )

Same problem?

@jonatandor35 I will test and let you know

@jonatandor35 StringArray.join(“,”) doesnt work…Returns nothing.