stackvana / hook.io

Open-Source Microservice Hosting Platform
https://hook.io
Other
1.26k stars 117 forks source link

KEYS property for Redis datastore #220

Open zanona opened 8 years ago

zanona commented 8 years ago

Perhaps there's already a way to achieve this but I have doc keys laid out the following pattern:

username/foo/1
username/foo/2
username/bar/1
username/bar/2

I would like to be able to achieve something where I can retrieve all keys based on wildcards like

username/*
username/foo/*

But apparently this isn't possible with the get command. I then found this on Redis documentation and wondered if there is a way to use this command or an alternative method on hook.io?

http://redis.io/commands/KEYS

Thanks

Marak commented 8 years ago

@zanona -

Any API commits you can land in https://github.com/bigcompany/hook.io-datastore will surface in hook.io.

It should be pretty easy to start adding more REDIS commands.

If you open up a Pull Request hook.io-datastore I can review and merge. I have a few other datastore updates I plan to push in the next release.

zanona commented 8 years ago

@Marak I've added the new method following https://github.com/NodeRedis/node_redis#clientmulticommands documentation, please let me know if that is satisfactory.

Ps. Also, can I just confirm if all users are 100% sandboxed to their own account datastore and there's no way any other user could gain access to someone else's datastore?

Thanks in advance.

Marak commented 8 years ago

Datastore in general should be considered "unsafe" right now.

We have a few tracking issues. I expect we'll have the datastore secure within the next month or so.

Marak commented 8 years ago

@zanona - If you have any code for review, please open a Pull Request to hook.io-datastore project.

Thanks!

zanona commented 8 years ago

Sorry :) forgot about the PR