redis / redis/node-redis

Add an object field name transformer to clean up results from RediSearch over JSON searches

Open
#1,729 2 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.