Im using fetch on a Rest endpoint which gives me a array of objects. All the keys in the array has a dot in them. ex: {test.name: "test"}. I have to keep fetching new responses to get changes so while i can remove or replace the dot this will take some time/resources every time. Is there any way to use keys with dots in fuse.js?
I tried some variants of this with no luck.
const fuse = new Fuse(this.state.test, {
keys: ['test.name']
});
ps. I cant change the keys in the Rest as its external
As of Fuse.js v6.3.0 you can search through nested values by providing the path via dot (
.) or array notation. Therefore, if your key already has a dot in it, you can wrap it in an array: