-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: use getBatch/setbatch for mget/mset #31
Conversation
test/multiple-set-get.test.ts
Outdated
if (process.env.MOMENTO_ENABLED === 'true') { | ||
expect(getResp).toEqual([value]); | ||
} else { | ||
expect(getResp).toEqual([value, null]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels wrong to me. I think we should be able to return the same result that redis does here. Can you help me understand why we can't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because GetBatch Response from sdk returns a map/record of keys and values for only the keys that exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also exposes a results
function to get the raw results. But even with the map/record versions, you have the list of keys that they asked for, in the order that they asked for them, so you could just add null
s into the return value for anything that didn't show up in the map, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left another question about the nulls
PR Description:
Follow-up PR for #29. This commit does the following:
Note
The Momento GetBatch operation returns a record or map containing only the keys for which values exist. It does not include keys that do not exist in the cache. Hence, validating the null case for Momento and Redis separately in the integ tests.
Issue:
https://github.com/momentohq/dev-eco-issue-tracker/issues/789