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

Request support for smismember #361

Closed
mikemole opened this issue Oct 23, 2023 · 3 comments · Fixed by #374
Closed

Request support for smismember #361

mikemole opened this issue Oct 23, 2023 · 3 comments · Fixed by #374

Comments

@mikemole
Copy link

Hi. I'd like to request support for smismember. Thanks!

@mikemole
Copy link
Author

FYI, here's my implementation in an interceptor:

    private Slice smIsMember(OperationExecutorState state, String roName, List<Slice> params) {
        if ("smismember".equalsIgnoreCase(roName)) {
            Slice set = params.get(0);
            List<Slice> sIsMemberSlices = params.stream()
                    .skip(1)
                    .map(param -> {
                        List<Slice> sIsMemberParams = new ArrayList<>();
                        sIsMemberParams.add(set);
                        sIsMemberParams.add(param);
                        return MockExecutor.proceed(
                                state,
                                "sismember",
                                sIsMemberParams);
                    })
                    .collect(Collectors.toList());
            return Response.array(sIsMemberSlices);
        } else {
            // Delegate execution to JedisMock which will mock the real Redis behavior
            return MockExecutor.proceed(state, roName, params);
        }
    }

@inponomarev
Copy link
Collaborator

Thanks for the request and interceptor, yes this is a simple operation, expect it in the next release

@mikemole
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants