Sort List by # of Relationships?

Hey y’all!

I’m working on an MVP where you can recommend restaurants, and search for restaurants recommended by your friends.

I have a list with all the Restaurants in a specific city, and each one has the number of Users that recommend it.

I have two collections, one with Users and one with Restaurants. A User can have a relationship with multiple restaurants and vice-versa (e.g. a user can recommend multiple restaurants, and a restaurant can be recommended by multiple users)

Is it possible to sort the list of Restaurants by the # of Users?

You need to add a counter (type Number) to your collection.Each time you add/remove a new relation you can increase (Counter = Counter + 1) or decrease (Counter = Counter -1). This way you can use the counter for sorting in lists.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.