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

Add path defaults to all commands #12

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

daTokenizer
Copy link

for ease of use, the default path would always be the root as defined by Path.rootPath()

@coveralls
Copy link

coveralls commented Oct 23, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 7bf76ea on daTokenizer:master into 5e1ea9a on RedisLabs:master.

@itamarhaber
Copy link
Collaborator

Defaulting to the root path makes sense imo.

This PR, however, also bundles a new command, jsonmgetl, which accepts a list of key names instead of the existing variadic format of jsonmget. This I like less :) As a compromise, I can live with how redis-py's mget works, by accepting both a list and arguments. However, I'd like to see that come in as a separate change to the code, tests and documentation.

@@ -252,6 +252,19 @@ Gets the objects stored as a JSON values under ``path`` from
keys ``args``


### jsonmgetl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate PR

pieces.append(str_path(path))
return self.execute_command('JSON.MGET', *pieces)

def jsonmgetl(self, keys=[], path=Path.rootPath()):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate PR - jsonmget's signature should change (breaking bw compat) to jsonmget(self, path=Path.rootPath(), keys=[], *args)

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

Successfully merging this pull request may close these issues.

3 participants