You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MemoryStore __eq__ does not behave as expected #788
When two memory stores are instantiated with the same collection_name, they are isolated and do not interact with each other. When a document is inserted into one MemoryStore, it is not visible from the other MemoryStore. Therefore, one would expect that these stores are not equivalent and the MemoryStore.__eq__() should return False, but this is not the case. Is this intended behavior?
@sivonxay if I am successful replacing mongomock (see #846 ), then this behavior will change. Two MemoryStore instantiated with the same collection name will actually point to the same collection and will evaluate as equal. If they are instantiated with different collection names, they will evaluate unequal.
Activity
munrojm commentedon May 22, 2023
I see the issue here. This should definitely be fixed. Thanks for bringing it up.
rkingsbury commentedon Jul 21, 2023
I'm investigating some improvements to
MemoryStoreand will try to tackle this as part of that effort.rkingsbury commentedon Aug 25, 2023
@sivonxay if I am successful replacing
mongomock(see #846 ), then this behavior will change. TwoMemoryStoreinstantiated with the same collection name will actually point to the same collection and will evaluate as equal. If they are instantiated with different collection names, they will evaluate unequal.Does that behavior make sense to you?
sivonxay commentedon Aug 25, 2023
I think that sounds reasonable. That would be behavior I expect from the comparison
Preserve MemoryStore identity across serialization for MultiStore
Fix materialsproject#788: make MemoryStore equality reflect data isol…
Preserve MemoryStore identity across serialization for MultiStore