Collection
A named group of documents backed by a single MMKV file.
Open a collection only when a set of documents needs a distinct lifecycle or access pattern — a wipe-on-logout cache, per-user scoping, or an encryption boundary. For the common case, open documents directly on the default store with Documents.document.
Every instance opened on the same collection name shares one change bus and one set of write locks, including instances obtained through separate calls to Documents.collection. A write through one instance is observed by Document.flow on any other instance of the same document, and concurrent updates through different instances do not lose writes.
Single-process only. The backing MMKV store is always opened in single-process mode. Concurrent access to the same store from more than one OS process (a background service, an app extension, etc.) is not supported and can corrupt the store. There is no supported way to share a store across processes with this library — MMKV's own cross-process mode exists, but its change notification is lazy/pull-based with no per-key granularity and no real-time guarantee on either platform, so it is not exposed here.