Closed evshvarov closed 4 years ago
We'll need navigational methods such as: First(), Next(), Previous() and Last() both on the IdKey and on Indices. So something like:
Multi-level indices would then be a little harder I've discussed this many years ago with ISC developers but they were very reluctant to implement this. The argument was to use SQL for this. (I didn't/don't agree)
@hermanslagman What is the point of having First, Next, Previous and Last for IdKey, if it is unique and they all should return the same value? I'm curious now, how one can add methods into the system class like %Persistent or wherever the methods for working with indices are realized?
see the article on this topic https://community.intersystems.com/post/indexnameopen-and-navigation-methods-non-unique-indexes
InterSystems Objects has the feature to get the Id of instance for a property value if the property has Unique Index. e.g.: ClassMethod IndexOpen(val, concurrency, sc As %Status) and ClassMethod IndexExists(val, Output id) As %Boolean
Learn more in this article: https://community.intersystems.com/post/useful-auto-generated-methods
This works only for Unique indexes. It'd be great if we have auto-generated methods for navigation on instances which have same values for the property with the option to get the all the id for the property value.