Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement has() and hasMany() #111

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Implement has() and hasMany() #111

wants to merge 2 commits into from

Conversation

vweevers
Copy link
Member

@vweevers vweevers commented Dec 29, 2024

Adds support of two methods:

await db.put('love', 'u')
await db.has('love') // true
await db.hasMany(['love', 'hate']) // [true, false]

Ref: Level/community#142

@vweevers vweevers added enhancement New feature or request semver-minor New features that are backward compatible labels Dec 29, 2024
binding.cc Outdated Show resolved Hide resolved
Adds support of two methods:

```js
await db.put('love', 'u')
await db.has('love') // true
await db.hasMany(['love', 'hate']) // [true, false]
```

Ref: Level/community#142
Category: addition
@vweevers
Copy link
Member Author

vweevers commented Jan 26, 2025

Optimized it by using an iterator instead of many Get() calls, and a bitset instead of many napi_set_element calls.

@vweevers vweevers marked this pull request as ready for review January 26, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-minor New features that are backward compatible
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

1 participant