InvoDB/demo/test.js

24 lines
517 B
JavaScript
Raw Normal View History

2021-11-13 23:15:21 +08:00
const fs = require('fs')
2021-11-12 15:58:21 +08:00
const invodb = require('..')
invodb.database('zzz.invodb')
let col = invodb.colection('blog')
if(!col.exist()) col.create();
2021-11-22 14:34:31 +08:00
// for(let json of col.query({})) col.remove(json)
2021-11-12 15:58:21 +08:00
2021-11-22 14:34:31 +08:00
// let list = fs.readFileSync(__dirname + "/list.txt").toString().split("\n")
// for(let json of list) {
// col.insert(JSON.parse(json))
// }
2021-11-12 15:58:21 +08:00
2021-11-13 23:15:21 +08:00
let result = col.query({
2021-11-22 14:34:31 +08:00
__INVO_ID__: 'oev3yzmydgdvtxg82zbzmrl6gbu73ax7'
2021-11-13 23:15:21 +08:00
})
2021-11-13 12:53:14 +08:00
2021-11-13 23:15:21 +08:00
console.log(">>>>>>>>>>>>>>>>>>>>")
2021-11-13 12:53:14 +08:00
console.log(result)
console.log(result.length)