其他分享
首页 > 其他分享> > m1.模块 indexDb

m1.模块 indexDb

作者:互联网

indexedDb模块

快捷操作indexedDb

使用:

// 初始化

let idb=indexDb.new(prop?)

参数:

  (可选)

  prop={

    // 数据库名称
    "databaseName": "defaultDB",

    // 表格名称
    "tableName": "defaultTbl",

    // 主键名称
    "keyPath": "cacheKey"
  }

// 保存

idb.set('id1',{name:'zhangsan',age:'16'})

// 读取

idb.get('id1')

// 搜索

idb.search('name','san','')

参数:

  param1: object key      要搜索的对象字段名

  param2: object value like    要搜索的对象字段值包含内容(模糊搜索)

  param3: primaryKey starts with  要搜索的主键筛选(左匹配), 不限制传''空字符串

--------------------------------

下面正式代码:

 

标签:indexedDb,主键,搜索,模块,m1,id1,idb,indexDb
来源: https://www.cnblogs.com/huanleshidai/p/16069899.html