Minimalistic RedisBloom client for Node.js
- Node.js >= 8.0.0
- Redis >= 4.0
- RedisBloom >= 2.0.0
npm i @albert-team/rebloom
yarn add @albert-team/rebloom
Important:
- Rebloom v2 is nearly a rewrite from scratch, thus not backward-compatible with Rebloom v1.
- RedisBloom module needs to be loaded into Redis server beforehand.
const { BloomFilter } = require('@albert-team/rebloom')
const main = async () => {
const filter = new BloomFilter('filtername')
await filter.connect()
console.log(await filter.add('item0')) // 1
console.log(await filter.exists('item0')) // 1
console.log(await filter.exists('item1')) // 0
await filter.disconnect()
}
main()
Read more here.