google 共享驱动器搜索 api

google shared drive search api

我有很多 google 共享驱动器和其中的许多内容,目前正在尝试搜索一些查询,但我只得到有限的结果,但是当我尝试在驱动器中搜索这些查询时,我得到了很多结果.

通过 API 回复:- res.json

我的代码是:-

try {
    Drive.files.list({
        q: "name contains 'jeet' ",
     // q: "fullText contains 'jeet' ", -- this is also get 2-3 result
        supportsAllDrives: true
    }, function(err, res) {
        if (err) {
            console.log(err)
        }
        if (res) {
            console.log(res)
            fs.writeFile("./res.json", JSON.stringify(res.data, null, 2), function(err, res) {})
        }
    })
} catch (error) {

}

当我实际在 google 驱动器中搜索时:- i got thousands of resualts

在你的情况下,如何添加 corporaincludeItemsFromAllDrives 的属性如下?

修改后的脚本:

发件人:

Drive.files.list({
    q: "name contains 'jeet' ",
 // q: "fullText contains 'jeet' ", -- this is also get 2-3 result
    supportsAllDrives: true
}, function(err, res) {

发件人:

Drive.files.list({
    q: "name contains 'jeet' ",
 // q: "fullText contains 'jeet' ", -- this is also get 2-3 result
    supportsAllDrives: true,
    corpora: "allDrives", // Added
    includeItemsFromAllDrives: true, // Added
}, function(err, res) {

参考: