1.0.12 • Published 10 months ago

iodb v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

iodb

测试用例

  • ⚡️ 丝滑手感 indexedDB操作库
  • 📚 传输体积 2.8KB
  • ☀️ 无需等待数据库链接完成, 直接写业务CRUD
import { connect } from 'iodb';

const db = connect({
    name: 'oker',
    tables: {
        /**
         * 初始化表格索引, 支持 primary | unique | index
         */
        test: { primary: '_id' }
    }
});

const col = db.getCollection('test');

table.find({
    _id: {
        $or: [
            { $gte: 9 },
            { $lte: 4 },
        ]
    },
    name: {
        $in: [456]
    }
}).then(res => {
    console.log('Case15', res);
});

API

查询操作

findById
findOne
find

更新操作

⚠️主键重复则覆盖原记录

⚠️记录未匹配则插入记录

updateOne
updateMany

删除操作

deleteOne
deleteMany

索引

connect({
    // 必选
    tables: {
        // 表名
        colname: {
            // 必选:主键名
            primary: '_id',

            // 可选:在给定的字段上分别建立唯一索引
            unique: []

            // 可选:在给定的字段上分别建立非唯一索引
            index: []
        }
    }
})

查询符

$lt
$lte
$gt
$gte
$eq
$ne
$all
$in
$nin
$or

todo

  • sort
  • skip
  • limit
  • group
  • project
  • count
  • alias
1.0.11

10 months ago

1.0.12

10 months ago

1.0.2

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.10

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago