An open API service indexing awesome lists of open source software.

https://github.com/mojtaba-afraz/doxor.js

❇️ Doxor.js : more comfortable interacting with IndexedDB
https://github.com/mojtaba-afraz/doxor.js

browser database frontend indexeddb javascript storage

Last synced: 13 days ago
JSON representation

❇️ Doxor.js : more comfortable interacting with IndexedDB

Awesome Lists containing this project

README

          

# doxor.js


logo


Offline database in Front-End
library for interacting with IndexedDB



## Install Doxor.js using npm

```
npm i doxor.js
```

## Creating a database

```javascript
import Doxor from "doxor.js"

const dbName = new Doxor('dbName')
```

## Specify the structure

```javascript
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

### result:



## Insert Record

```javascript
dbName.Insert('users',{name:"john",email:"john@email.com"})
```

## Get Record

```javascript
dbName.get('users',1,result => {
console.log(result)
})
```

## Get All Records

```javascript
dbName.getAll('users',result => {
console.log(result)
})
```

## remove Record

```javascript
dbName.remove('users',1)
```