I have tables Keyword, User, Event. Tables User and Event both have a one-to-many relation to Keyword called keywords. Now I have a User object and want to query Event table by counting the keywords of each Event object that are also in the User object’s keywords and sorting the Event objects by the count.
For example, we have the User(keywords: [“game”, “comic”]), Event(name: “event1”, keywords:[“game”, “mario”]), Event(name:“event2”, keywords:[“comic”]), Event(name: “event3”, keywords:[“game”, “comic”]), Event(name: “event4”, keywords: [“travel”]). After the query, the order will be “event3”, “event1”, “event2”, “event4” because event3 has two keywords matches, event1 and event2 have one keyword match while event4 has 0.
Is this feasible in the Backendless’s database? If so, how to build such a query?