Interact with your Elasticsearch data
Interact with your Elasticsearch data
Creating the Smart Collection
const { collection } = require('forest-express-sequelize');
collection('bank-accounts', {
isSearchable: false,
fields: [
{
field: 'id',
type: 'string',
},
{
field: 'account_number',
type: 'Number',
isFilterable: true,
},
{
field: 'address',
type: 'String',
isFilterable: true,
},
{
field: 'firstname',
type: 'String',
isFilterable: true,
},
{
field: 'lastname',
type: 'String',
isFilterable: true,
},
{
field: 'age',
type: 'Number',
isFilterable: true,
},
{
field: 'balance',
type: 'Number',
isFilterable: true,
},
{
field: 'city',
type: 'String',
isFilterable: true,
},
{
field: 'employer',
type: 'String',
isFilterable: true,
},
{
field: 'email',
type: 'String',
isFilterable: true,
},
{
field: 'gender',
type: 'Enum',
isFilterable: true,
enums: ['M', 'F'],
},
{
field: 'state',
type: 'String',
isFilterable: true,
},
],
});Implementing the routes
Name
Type
Description
Implementing the GET (all records)
Implementing the GET (a specific record)
Implementing the PUT
Implementing the DELETE
Implementing the POST
Last updated
Was this helpful?