RxDBJavaScript 数据库
RxDB 是一个 JavaScript 客户端数据库,主要用于浏览器、NodeJS、Electron、Cordova、React-Native 以及其他任何 JavaScript 运行环境。
示例代码:
import * as RxDB from 'rxdb';
RxDB.create('heroesDB', 'websql', 'myLongAndStupidPassword', true) // create database
.then(db => db.collection('mycollection', mySchema)) // create collection
.then(collection => collection.insert({name: 'Bob'})) // insert document
//查询
myCollection
.find()
.where('name').ne('Alice')
.where('age').gt(18).lt(67)
.limit(10)
.sort('-age')
.exec().then( docs => {
console.dir(docs);
});
评论
