- 
                Notifications
    
You must be signed in to change notification settings  - Fork 27
 
Description
Description:
I recently found an unexpected behaviour that removing all entities from the IndexedMap does nothing with the indexes, so the indexes start to reference non-existing data in the main collection and lead to StdError::msg("pk not found") error when searching some data by index after deletions.
In my understanding, the clear function should remove the data completely to keep the underlying storage in a consistent state.
Also, it is worth noting that there is no convenient method to clear data from the indexes separately.
Please see the PR with unit test (red now) that reproduces the issue: #116
Steps to reproduce:
- Create 
IndexedMap - Add a few entities
 - Call 
clear - Verify a count of entities in the defined indexes
 
Actual Behaviour: Each index returns all previously saved entities defined by inthe dex.
Expected Behaviour: Each index should be empty.
Question:
If you find it important to fix, I could work with the pull request on the implementation.
UPD: PR is ready for review