How to use datasources.mem ?

In the JSDoc of mem, I found.:

mem: MemDataSource

Scope property for in-memory data sources.

datasources.mem[‘myds’]

@return MemDataSource

I tried:

datasources.mem[ foundset.getDataSource( ) ].getFoundSet( );

but it does not work. What is ‘myds’ and how can I use datasources.mem?

the id is the id that you gave when you created the in mem datasource
the getDataSource === a full url including the id (so mem:id) you only should work with the id.

jcompagner:
the id is the id that you gave when you created the in mem datasource
the getDataSource === a full url including the id (so mem:id) you only should work with the id.

What “id” do you mean? I don’t have created an in mem datasource. I want to create one. So first I need to create an inmem datasource, so that I can use the inmem datasource?

yes ofcourse you first have to create one in your solution, how else would you ask for a foundset?
You also have to have a server/table combination before you can ask for a (normal) foundset.

jcompagner:
yes ofcourse you first have to create one in your solution, how else would you ask for a foundset?
You also have to have a server/table combination before you can ask for a (normal) foundset.

Yes, I don’t see how I can create and use a inmem datasource, because there is no information in JSDoc about that. Where do I have to look in the wiki? I googled but found no information.

https://wiki.servoy.com/dosearchsite.ac … e=conf_all

Is this the correct creation of an in-memory foundset?

var dataSet = databaseManager.convertToDataSet( foundset );
var dataSource = dataSet.createDataSource( 'name' );
var inMemFS = datasources.mem[ dataSource ].getFoundSet( );
inMemFS.loadAllRecords( );