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
For my app, I wanted reads (i.e., find and findOne) to reflect uncommitted changes in the current transaction, like in a real transactional database, without having to use instant mode and exposing those changes to other readers. This package could have an option to do that.
The basic idea would be to keep a minimongo collection of the updated, uncommitted documents and have a find implementation that queries both the uncommitted changes and the underlying data source and combines the results correctly. Implementing the basic find/findOne of an arbitrary selector wouldn't be bad, but supporting sort, skip, limit, and observe/observeChanges would get complicated. This "collection overlay" library may belong in a separate package, like minimongo itself.
In my app, the collections are small enough that I just make temporary copies of all the collections, work on the temporary collections, and at the end of the transaction, diff the temporary collections against the original collections one document at a time and issue the corresponding insert/update/remove operations (implementation). This has the side benefit that my app can use API features that Minimongo supports and this package currently doesn't (e.g., #80).
The text was updated successfully, but these errors were encountered:
For my app, I wanted reads (i.e.,
find
andfindOne
) to reflect uncommitted changes in the current transaction, like in a real transactional database, without having to use instant mode and exposing those changes to other readers. This package could have an option to do that.The basic idea would be to keep a minimongo collection of the updated, uncommitted documents and have a
find
implementation that queries both the uncommitted changes and the underlying data source and combines the results correctly. Implementing the basicfind
/findOne
of an arbitrary selector wouldn't be bad, but supportingsort
,skip
,limit
, andobserve
/observeChanges
would get complicated. This "collection overlay" library may belong in a separate package, like minimongo itself.In my app, the collections are small enough that I just make temporary copies of all the collections, work on the temporary collections, and at the end of the transaction, diff the temporary collections against the original collections one document at a time and issue the corresponding insert/update/remove operations (implementation). This has the side benefit that my app can use API features that Minimongo supports and this package currently doesn't (e.g., #80).
The text was updated successfully, but these errors were encountered: