JSFiddle - React, Tailwind, and code Playground
by leoliaolei
HTML
<script src="http://s3-ap-southeast-1.amazonaws.com/ydn-db-d1/0.8.12/ydn.db-i-core-qry.js"></script>
JavaScript
var db = new ydn.db.Storage("MyTest", {
stores: [{
name: "node",
keyPath: "id",
indexes: [{
keyPath: "__status"
}]
}]
});
var testNode = {
id: Date.now(),
name: 'test'
};
db.put({
name: "node",
keyPath: "id",
__status:-1
}, testNode);
var q = db.from("node").where("__status", ">", -1);
q.list().done(function (records) {
console.log(records);
});