A lightweight embedded persistent or in-memory database for React Native, providing a subset of MongoDB's API (NeDB-compatible). Current stable version is 4.0.0. It uses AsyncStorage for persistence on React Native. Key differentiators: no native dependencies, TypeScript types included, supports indexing, serialization hooks, and timestamp data. Compared to alternatives like WatermelonDB or Realm, it is simpler and ideal for small offline-first apps. The library switched from promise-based methods to callback-style in v2.0.0, adding Async methods.
npm install react-native-local-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a persistent Datastore, insert a document using both callback and Async methods, and perform a simple find with sorting.
Use callback syntax or switch to Async methods (e.g., insertAsync) for promises.
If you need persistence, set inMemoryOnly to false and provide a filename.
Consider using a more robust solution like WatermelonDB if data durability is critical.
Ensure your hooks are exact inverses and test with various string lengths.
Use autoload: true or load the database via loadDatabase callback before performing operations.
Update to v2.0.0+ or use callback-based insert.
If you want in-memory, omit filename. If you want persistence, set inMemoryOnly: false.