Restricting Search

Trying to restrict search options in UI. Adding these option to a Mongoose collection:
collection(‘users’, {
isSearchable: false,
searchFields: [‘id’, ‘email’, ‘createdAt’, ‘updatedAt’],

Expected behavior

According to https://docs.forestadmin.com/documentation/how-tos/settings/restrict-the-search-on-specific-fields at least I should not have the ability to search on other fields.

I would also want the extended search to be disabled

Actual behavior

UI appears with full test search and filter allows selection of any field and will filter based on any field.

Context

Please provide any relevant information about your setup.

  • Package Version: 6.1.4
  • Express Version:4.17.1
  • Sequelize Version:
  • Database Dialect: MongoDB
  • Database Version:
  • Project Name:
1 Like

Hello @Liam_Cheung :wave:

Welcome to our community :confetti_ball:

isSearchable only applies to smart collections, that’s why it doesn’t work (you need to disable the search on all fields of a collection to remove the search bar).
The searchFields option does its job on my end :thinking:, could you share with us your entire file ?
For the filters you can disable filtering for a field from the UI.
Finally, it is not possible to disable extended search at the moment.

Great thanks I misunderstood how it worked, I get it now and works great.

Glad to hear that :slight_smile: