I am using @albert-team/rebloom package for implementation of Bloom Filter using Local Redis
const { BloomFilter } = require('@albert-team/rebloom')
const main = async () => {
const filter = new BloomFilter('filtername', {
host: 'localhost',
port: 6379,
})
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().catch((err) => console.error(err))
but i get below error. TypeError: multi.setbit is not a function at /Users/rohit/Downloads/Microservices/POC/node_modules/bloom-redis/lib/index.js:61:15
Two Questions :
- How can i resolve the above issue?
- Is there any other package of approach i can use for Bloom Filter implementation?
Node Redis supports Redis Bloom now. Works like this: