-
-
Notifications
You must be signed in to change notification settings - Fork 877
Description
Hi,
I want to know if it's possible to sort my query in this way.
My className is called "Shop"
Each shop have a field called "campaignsDateString" who is an array of String like that :
["8/28/2020", "8/30/2020", "8/31/2020", "8/31/2020","9/1/2020"]
On my query I want to get all shops who have campaigns for specifics dateString, who is also an array of String
["8/28/2020", "8/30/2020]
So on my query I have this constraint
query.whereKey("campaignsDateString", containedIn:["8/28/2020", "8/29/2020])
if for example I have 2 shops like this
SHOP1
campaignsDateString = ["8/28/2020", "8/30/2020", "8/31/2020", "8/31/2020","9/1/2020"]
SHOP2
campaignsDateString = ["8/28/2020", "8/28/2020","8/28/2020", "8/28/2020","8/28/2020", "8/28/2020"]
I want to sort my results by occurrences of campaignsDateString matching my array ["8/28/2020", "8/29/2020]
The second shop have 5 times "8/28/2020" and the first shop only one time, so i want to get Shop 1 in first.
If someone have an idea of how to do that.
Thanks