Next: Persistent Set API, Previous: Persistent Object API, Up: User API Reference
Perform a map operation over all instances of class. Takes a function of one argument, a class instance. Setting the collect keyword to true will return a list of the values returned from calls to fn on successive instances of the class.
map-inverted-index maps a function of two variables, taking key and instance, over a subset of class instances in the order defined by the index. Specify the class and index by quoted name. The index may be a slot index or a derived index.
Read the docstring for map-index for details on what the various keywords do.
Retrieve all instances from the class index as a list of objects
Retrieve instances from a slot index by value. Will return only the first instance if there are duplicates.
Returns a list of all instances where the slot value is equal to value.
Returns a list of all instances that match values between start and end. An argument of nil to start or end indicates, respectively, the lowest or highest value in the index
Removes a list of persistent objects from all class indices and unbinds any slot values
This method is the way to access the class index via the class object. We can always fetch it or we can cache it in the class itself. It returns an indexed-btree.
This method finds an inverted index defined on the class described by an instance of persistent-metaclass.
Bind the var argument in the body to a class cursor on the index specified the provided class or class name
Bind the var argument to an inverted cursor on the index specified the provided class and index name
Enable a class instance index for this object. It's an expensive thing to support on writes so know that you need it before you do it.
Delete and remove class instance indexing and any secondary indices defined against it
Disable any class indices from the database, even if the current class object is not officially indexed. This ensures there is no persistent trace of a class index. Storage is reclaimed also
Add a per-slot class index option to the class index based on the class accessor method
Add a simple secondary index to this class based on a function that computes a derived parameter.
warning:
derived parameters are only valid on persistent slots. An arbitrary function here will fail to provide consistency on transient slots or global data that is not stored in the persistent store. Derived indexes are deleted and rebuilt when a class is redefined