OpenFn / OpenFn/adaptors

Add `mGet()` and `mSet()` function to `redis` adaptor

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
JavaScript
Stars
24
Forks
41
Avg merge
3d 13h
Merged PRs (30d)
12

Description

Background

The redis adaptor supports basic Redis commands, it lacks support for the mGet() and mSet() commands, which are essential for efficiently handling multiple key-value pairs in Redis.

Feature Request

I propose adding two new helper methods to the Redis adaptor: mGet() and mSet(). These methods should mirror the functionality of Redis's native json.mGet and json.mSet commands, allowing us to retrieve and set multiple key-value pairs in a single operation.

Implementation Details
  1. mGet(keys: Array<string>):

    • Accepts an array of strings, where each string is a key in Redis.
    • Returns an array of values corresponding to the provided keys.
  2. mSet(keyValuePairs: Object):

    • Accepts an object where each key-value pair corresponds to a Redis key and its associated value.
    • Sets all the key-value pairs in Redis in a single operation.
Use Cases
  • mGet(): This will be particularly useful when retrieving multiple related values from Redis in a single call, reducing the need for multiple jGet operations and improving performance.
  • mSet(): This will allow us to efficiently store multiple key-value pairs at once, which is beneficial when working with bulk data.

Redis Docs

Contributor guide

No contributing guide indexed for this repository

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 by locating the Redis adaptor and its existing jGet operations. Add mGet for retrieving multiple keys and mSet for storing multiple key-value pairs in one operation, then verify that both methods match the requested inputs, returned values, and Redis JSON command behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, redis
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.