Created
January 24, 2022 02:23
-
-
Save phpsmarter/f8c3bf5c261fb46f5d9283a96792244d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// local, node database | |
import level from 'pouchdb-adapter-leveldb' | |
import Pouchy from 'pouchy' | |
Pouchy.plugin(level) | |
type Fruit = { | |
type: string, | |
tastes: string | |
} const fruit = new Pouchy<Fruit>({name : 'fruit'}) | |
const orange = await fruit.save({type : 'orange', tastes : 'delicious'}) | |
console.log(orange) | |
/** | |
{ | |
type: 'orange', | |
tastes: 'delicious', | |
_id: 'EA1F2B55-2482-89C6-907E-6F938C59F734', | |
_rev: '1-f60b9b7d775a89d280e1f4c07122b863' | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment