Collection selection

This is the official documentation of the @forestadmin/agent Node.js agent.

You may not want to import all collections from a data source.

This can be achieved by providing a whitelist or a blacklist in the options of the agent.addDataSource method.

const { createAgent } = require('@forestadmin/agent');
const { createSqlDataSource } = require('@forestadmin/datasource-sql');

const agent = createAgent(options);
const aDataSource = createSqlDataSource(
const anotherDataSource = createSqlDataSource(

// Specify which collections you want to play with
  .addDataSource(aDataSource, { include: ['books', 'reviews'] })
  .addDataSource(anotherDataSource, { exclude: ['authors'] });

Last updated