Does the realm.io database support multi column indexes or sorted indexes?

不想你离开。 提交于 2019-12-12 20:26:05

问题


Does the realm.io database support multi column indexes or sorted indexes?

The documentation does not mention these features, but that seems odd since Realm is billed as a replacement for core data.


回答1:


Yep!

  1. Realm lets you define multiple indexed properties in a single object class by overriding the indexedProperties class method and returning an array of the names of the properties you wish to index. Realm mentions this in the documentation here.

  2. You can sort objects by an index (Or any other property for that matter) by using the [RLMResults sortedResultsUsingProperty:ascending:] after querying for a group of objects. That's covered in the documentation here.

Please let me know if you require any additional clarification. :)



来源:https://stackoverflow.com/questions/33978682/does-the-realm-io-database-support-multi-column-indexes-or-sorted-indexes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!