realm-kotlin
                                
                                 realm-kotlin copied to clipboard
                                
                                    realm-kotlin copied to clipboard
                            
                            
                            
                        Feature request: Sort by a given list
Description
Sometimes we would like to be able to sort on objects but in relation to a given list.
Except that currently, we can only sort on a property in ASC or DESC.
Example
sort("type", arrayOf("shared", "favorite", "offline")).find()
Currently Core doesn't support this type of querying. You can add a feature request there.
If you need to write code that supports this functionality you could do it at a Kotlin level by combining 3 queries and reducing the result in Kotlin itself. You can also use copyFromRealm on the output and do the computation in memory instead.
@edualonso Ok thanks for your answer, and so I created the ticket in Core. But if not, we currently sort ourselves in kotlin so it works but having this feature would simplify a lot.