0.12.2 • Published 5 years ago

pouch-odm v0.12.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.8.4

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.3

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.8.2

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.4.14

5 years ago

0.5.0

5 years ago

0.4.13

6 years ago

0.4.12

6 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago