We seem to have had a lot of questions recently regarding the storage API, to which I find myself repeating the same response a lot.
Here is a definitive response to which I will link anyone who asks about it - only if their question is not directly answered here will I give any more of a response - for example, if there is a specific question about a specific point of implementation.
The storage API is documented here: http://nodered.org/docs/api/storage/index.html
We have a CouchDB implementation and a MongoDB implementation in the node-red-bluemix repository on GitHub. They are both slightly out of date - the MongoDB one more so.
But they should provide starting points to anyone wanting to use these databases behind Node-RED.
We will be publishing the mongo and couchdb storage plugins, once they are updated and properly tested, to their own repositories on github. Can't say when exactly that will happen.
Nick
Perhaps I am missing something, but the Storage API documentation does not make clear how one actually sets up the default database as the "Storage" object (under Bluemix). Ideally there would be an example flow (or function) that demonstrates the use of the Storage API for each of the methods.
In my case, I am trying to use the Storage API to maintain a set of session variables. I do have the proper 'storageModule: require("./couchstorage")' in my bluemix-settings.js file, but when I include any reference to "Storage" in my functions (e.g. Storage.getSessions()), I get an error ("Storage is not defined"). I've searched high and low (this forum, the flow library, stackexchange, etc.) for any working example of the use of the Storage API in a working function or flow, but to no avail. I'm sure it's an obvious configuration or initialization problem, but I can't find the right incantation.
I'm afraid the problem is that Node-RED appears simple enough to empower newbies like myself, but still requires detailed examples for us to make it work.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.