Hi, I'm using JavaScript API on Node.js, it works almost good and smooth.
But I see a strange result on filesSearchV2.
My code is like...
const files = await dropbox.filesSearchV2({query: keyword,
options: {path: '/' + targetDirectory,
file_status: "active",
filename_only: true}
})
.then(response => {
const metadataFiles = response.result.matches.filter(x => x.metadata.metadata['.tag'] == 'file');
// Here is Strange Point. I set 'path' but this code picks other path's files. But it's not same as Root.
// I have to check path myself.
const regex = new RegExp(targetDirectory);
const pathFilteredFiles = metadataFiles.filter(x => regex.test(x.metadata.metadata.path_display) == true);
if (pathFilteredFiles)
{
return pathFilteredFiles.map(x => x.metadata.metadata)
} else {
return null;
}
})
.catch(error => {
console.error(error);
});
I expect searchV2 is focus defined Path.
I referenced following example,
https://www.dropbox.com/developers/documentation/http/documentation#files-search
Do I mistake something?