Add an object field name transformer to clean up results from RediSearch over JSON searches
Open
Nobody has claimed this yet.
feature
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
When we perform a search over JSON document content, it would be nice to provide an extra object parameter describing how to name fields in the objects returned...
Example:
let results = await client.json.get('noderedis:jsondata', {
path: ['.pets[1].name', '.pets[1].age']
});
might return:
{ '.pets[1].name': 'Rex', '.pets[1].age': 3 }
Proposing that something like this:
let results = await client.json.get('noderedis:jsondata', {
path: ['.pets[1].name', '.pets[1].age'],
responseMap: {
'.pets[1].name': 'name',
'.pets[1].age': 'age'
}
});
would return:
{ 'name': 'Rex', 'age': 3 }
Contributor guide
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 at the client.json.get entry point described in the issue and trace how JSON search paths become returned object keys. Add support for the proposed responseMap behavior, then verify that the example paths produce the keys name and age with their original values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- redis, typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100