0.12.2 ā¢ Published 4 years ago
pouch-odm v0.12.2
Pouch ODM
š§ This library is in construction. More is coming soon!
š
What's coming
pouch-odm
is a document mapper for pouchdb with full TypeScript support. It lets you use rich, type-safe models on top of pouchdb.
Here's a preview of the API as it currently stands:
import { pouchOdm } from 'pouch-odm';
import PouchDB from 'pouchdb';
import Memory from 'pouchdb-adapter-memory';
PouchDB.plugin(Memory);
const db = new PouchDB('test', { adapter: 'memory' });
const { defineModel } = pouchOdm(db);
interface IUser {
email: string;
name: string;
}
const User = defineModel<IUser>('user', {});
// create or update users
await User.upsert({ email: 'jdoe@email.com', name: 'John Doe' });
// find by id
await User.findById(id);
// find all users who have the name "John Doe"
await User.findAll({ name: 'John Doe' });
// remove user from database
await User.remove(user);
0.12.2
4 years ago
0.12.1
4 years ago
0.12.0
4 years ago
0.11.0
4 years ago
0.8.4
4 years ago
0.10.0
4 years ago
0.9.0
4 years ago
0.8.3
4 years ago
0.8.1
4 years ago
0.8.0
4 years ago
0.8.2
4 years ago
0.7.0
4 years ago
0.6.0
4 years ago
0.4.14
4 years ago
0.5.0
4 years ago
0.4.13
4 years ago
0.4.12
4 years ago
0.4.11
4 years ago
0.4.10
4 years ago
0.4.9
4 years ago
0.4.7
4 years ago
0.4.6
4 years ago
0.4.5
4 years ago
0.4.4
4 years ago
0.4.3
4 years ago
0.4.2
4 years ago
0.4.1
4 years ago
0.4.0
4 years ago
0.3.1
4 years ago
0.3.0
4 years ago
0.2.0
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago