# Multiple Content Stores

**URL:** <https://discourse.nodered.org/t/multiple-content-stores/11879>\
**Category:** General\
**Created:** [5 June 2019 15:48 UTC](https://discourse.nodered.org/t/multiple-content-stores/11879 "2019-06-05T15:48:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bra1nK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bra1nk/32/11837_2.png) [@Bra1nK](https://discourse.nodered.org/u/Bra1nK)\
**Post date:** [5 June 2019 15:48 UTC](https://discourse.nodered.org/t/multiple-content-stores/11879/1 "2019-06-05T15:48:16Z")

</div>

I've been playing with the recent context storage enhancements after updating to version 0.20.05 and don't get a choice in the ui for which store to use as stated in the docs [Using Context in a flow](https://nodered.org/docs/user-guide/context#using-context-in-a-flow) below are the relevant lines from my settings.js  
_contextStorage: {_

- 

```
 default: "memoryOnly",*

```

- 

```
 memoryOnly: { module: 'memory' },*

```

- 

```
 file: { module: 'localfilesystem' }*

```

- },\*  
I can use file storage in function code e.g. "_flow.set("count", 123, storeName);_" and have verified file storage is used but get nothing in the ui as is stated in the docs. I've even tried without _default: "memoryOnly",_ in settings.js to no avail.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 June 2019 16:14 UTC](https://discourse.nodered.org/t/multiple-content-stores/11879/2 "2019-06-05T16:14:06Z")

</div>

It should look like this:

```javascript
    contextStorage: {
        default: {
            module:'memory'
        },
        file: {
            module: 'localfilesystem'
        }
    },

```

So that the default entry is memory as per previous versions of Node-RED. Then you can use the "file" scheme for persistent storage.

I got confused with this as well. You don't define memory separately.

---

<div class="post-metadata">

**Author:** ![Bra1nK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bra1nk/32/11837_2.png) [@Bra1nK](https://discourse.nodered.org/u/Bra1nK)\
**Post date:** [5 June 2019 16:52 UTC](https://discourse.nodered.org/t/multiple-content-stores/11879/3 "2019-06-05T16:52:23Z")

</div>

Cheers got it working now my settings file was ok

```auto
	contextStorage: {
	   default: "memoryOnly",
	   memoryOnly: { module: 'memory' },
	   file: { module: 'localfilesystem' }
	},

```

but I messed up my post by formatting a block of text as italic for this forum which added bullets and "\*" to my message.  
However I had made the rookie error of not refreshing the web page displaying the node-red ui !!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 June 2019 18:15 UTC](https://discourse.nodered.org/t/multiple-content-stores/11879/4 "2019-06-05T18:15:29Z")

</div>

Oops, ignore the below. That error comes from something else in my test setup I think. I need a clearout.

* * *

> [@Bra1nK](#):
>
> contextStorage: { default: "memoryOnly", memoryOnly: { module: 'memory' }, file: { module: 'localfilesystem' } },

I get an error if I use your settings:

```auto
5 Jun 19:13:58 - [info] Context store : 'memoryOnly' [module=memory]
5 Jun 19:13:58 - [info] Context store : 'file' [module=localfilesystem]
5 Jun 19:13:59 - [warn] Unknown context store 'memory' specified. Using default store.

```

I remember Nick telling me that was the wrong way to do it.
