Parse-SDK-iOS-OSX icon indicating copy to clipboard operation
Parse-SDK-iOS-OSX copied to clipboard

Query With Custom Sorting, Occurrences In String Array

Open ljs19923 opened this issue 4 years ago • 1 comments

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

ljs19923 avatar Dec 24 '20 21:12 ljs19923

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

stale[bot] avatar Jul 21 '21 01:07 stale[bot]