queryBookings( ).hasSome() no longer works?

I had this piece of code which gets booking items with certain statuses and I use something like this:

    return bookings
        .queryBookings()
        .hasSome("status", ["CONFIRMED"])
 

Above had been working fine for many months now and all of sudden, I noticed today(12/24/2022) that I was getting no results and I see this error:

{
   "details" : {
      "applicationError" : {
         "description" : "Bad   Request",
         "code" : "INVALID_FILTER",
         "data" : {
            "mismatchedFieldType" : {
               "fieldPath" : "status",
               "mismatchedType" : "BookingStatus",
               "operator" : "$hasSome"
            }
         }
      }
   }
}

Did something change with Velo API?
The booking item data still does have “status” attribute.
I can’t seem to use hasSome() any longer. Luckily, since I was only passing single element, I was able to switch and use the eq() for now like below and that works, but what happened to hasSome()?

.eq("status", "CONFIRMED")
1 Like

Hi! It looks like you are using the hasSome operator in a query to filter bookings by their status. It seems that this operator is no longer valid and is causing an error with the Velo API, as indicated by the “INVALID_FILTER” error code and the “mismatchedFieldType” error data in the response. It is possible that the Velo API has changed and no longer supports the hasSome operator, or that there was a change in the way the status field is defined in the bookings data that is causing the operator to fail.

const queries = Array.map(ix =>  wixData
    .query('Collection')
    .contains('QueryingField', ix)
    .find())
const results = await Promise.all(queries)
const DataField = results.flatMap(r => r.items.map(i => i.DataField))

If you have been using hasome to query a collection for items in an array this will work just fine and return an array of results!