diff --git a/binding/nodejs/ReadMe.md b/binding/nodejs/ReadMe.md index 3402ecbfe115738a28c7ad3844f0d72eb419531f..e745ad159da86a6f4f7d0cd1148ea66febf7a701 100644 --- a/binding/nodejs/ReadMe.md +++ b/binding/nodejs/ReadMe.md @@ -15,7 +15,7 @@ try { const searcher = Searcher.newWithFileOnly(dbPath) // 查询 const data = await searcher.search('218.4.167.70') - // data: '中国|0|江苏省|苏州市|电信' + // data: {region: '中国|0|江苏省|苏州市|电信', ioCount: 3, took: 1.342389} } catch(e) { console.log(e) } @@ -37,7 +37,7 @@ try { const searcher = Searcher.newWithVectorIndex(dbPath, vectorIndex) // 查询 await 或 promise均可 const data = await searcher.search('218.4.167.70') - // data: '中国|0|江苏省|苏州市|电信' + // data: {region: '中国|0|江苏省|苏州市|电信', ioCount: 2, took: 0.402874} } catch(e) { console.log(e) } @@ -58,7 +58,7 @@ try { const searcher = Searcher.newWithVectorIndex(buffer) // 查询 await 或 promise均可 const data = await searcher.search('218.4.167.70') - // data: '中国|0|江苏省|苏州市|电信' + // data: {region:'中国|0|江苏省|苏州市|电信', ioCount: 0, took: 0.063833} } catch(e) { console.log(e) } diff --git a/binding/nodejs/tests/function.test.js b/binding/nodejs/tests/function.test.js index 87063b732170ac7da7231420a41eca59f86196f7..ab7c959cde66933511b18dee5f06c29e18c21775 100644 --- a/binding/nodejs/tests/function.test.js +++ b/binding/nodejs/tests/function.test.js @@ -14,19 +14,16 @@ const searcher3 = Searcher.newWithFileOnly(dbPath) describe('ip2region', () => { it('#newWithFileOnly and search', async () => { const d = await searcher3.search('218.4.167.70') - console.log(d) expect(d.region).equal('中国|0|江苏省|苏州市|电信') }) it('#newWithVectorIndex and search', async () => { const d = await searcher2.search('218.4.167.70') - console.log(d) expect(d.region).equal('中国|0|江苏省|苏州市|电信') }) it('#newWithBuffer and search', async () => { const d = await searcher1.search('218.4.167.70') - expect(d.region).equal('中国|0|江苏省|苏州市|电信') }) })