max-mapper / max-mapper/toiletdb
Handle nested keys
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 221
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
It'd be neat if toiletdb methods that accepted key parameters handled nested keys. For example:
// db.json = { ports: { http: 80, https: 443 } }
db.read('ports.http', function(err, data) {
console.log(data)
> 80
})
or:
// db.json = { ports: { http: 80, https: 443 } }
db.read(['ports', 'http'], function(err, data) {
console.log(data)
> 80
})
The second method avoids confusion where '.' may be a part of an attribute's name, ex: data['example.org']
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the toiletdb methods that accept key parameters, especially db.read, and inspect how they currently resolve keys from the JSON backend. Done means nested keys work with both dot-separated strings such as 'ports.http' and key arrays such as ['ports', 'http'], while preserving support for attribute names containing dots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100