Offline database in Front-End
library for interacting with IndexedDB
npm i doxor.js
import Doxor from "doxor.js"
const dbName = new Doxor('dbName')
const usersCollection = {
name: 'users',
indexes: [
{
key: 'name',
unique: false
},
{
key: 'email',
unique: true
}
]
}
dbName.Store(usersCollection)
name : Collection name
indexes [array of objects] : Each object carries collection field properties
dbName.Insert('users',{name:"john",email:"[email protected]"})
dbName.get('users',1,result => {
console.log(result)
})
dbName.getAll('users',result => {
console.log(result)
})
dbName.remove('users',1)