| Aug | SEP | Oct |
| 09 | ||
| 2024 | 2025 | 2026 |
COLLECTED BY
Collection: Save Page Now Outlinks
(add yours)
|
Logging Attachments ORM Conflict Handling Middleware Signals |
State Backup Replication Server Storages Local Documents |
Schema Validation Compression Migration Encryption CRDT Population |
npm install rxdb rxjs --save
import { createRxDatabase } from 'rxdb/plugins/core'; /** * For browsers, we use the localstorage based storage. * In other JavaScript runtimes, we can use different storages: * @link https://rxdb.info/rx-storage.html */ import { getRxStorageLocalstorage } from 'rxdb/plugins/storage-localstorage'; // create a database const db = await createRxDatabase({ name: 'heroesdb', // the name of the database storage: getRxStorageLocalstorage() }); // add collections await db.addCollections({ heroes: { schema: mySchema } }); // insert a document await db.heroes.insert({ name: 'Bob', healthpoints: 100 });
const aliveHeroes = await db.heroes.find({ selector: { healthpoints: { $gt: 0 } } }).exec(); // the exec() returns the result once
await db.heroes.find({ selector: { healthpoints: { $gt: 0 } } }) .$ // the $ returns an observable that emits each time the result set of the query changes .subscribe(aliveHeroes => console.dir(aliveHeroes));
npm i rxdb