Javascript 列出Firebase存储对象会忽略所有元数据
我一直在尝试获取存储桶特定文件夹中所有文件的列表,该列表运行良好,但没有关于该对象元的信息,如本文档所述: item对象的形状不同,而是为数组中的每个项提供一个“ReferenceCompat” 相反,只提供bucket、fullPath和name属性 有人知道这是为什么吗 这是提供的对象,而不是预期的对象:Javascript 列出Firebase存储对象会忽略所有元数据,javascript,firebase,google-cloud-storage,firebase-storage,Javascript,Firebase,Google Cloud Storage,Firebase Storage,我一直在尝试获取存储桶特定文件夹中所有文件的列表,该列表运行良好,但没有关于该对象元的信息,如本文档所述: item对象的形状不同,而是为数组中的每个项提供一个“ReferenceCompat” 相反,只提供bucket、fullPath和name属性 有人知道这是为什么吗 这是提供的对象,而不是预期的对象: ReferenceCompat: { "_delegate": { "_service": { &
ReferenceCompat: {
"_delegate": {
"_service": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxxx-xxxxxxxxx",
"authDomain": "xxxxxx",
"projectId": "xxxx",
"storageBucket": "xxxxxx",
"messagingSenderId": "xxxxxxxxx",
"appId": "xxxxxxxx"
}
},
"_authProvider": {
"name": "auth-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": {
"name": "auth-internal",
"multipleInstances": false,
"instantiationMode": "LAZY",
"type": "PRIVATE"
},
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_appCheckProvider": {
"name": "app-check-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": null,
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_pool": {},
"_firebaseVersion": "8.6.5",
"_bucket": {
"bucket": "xxxxx",
"path_": ""
},
"_host": "firebasestorage.googleapis.com",
"_appId": null,
"_deleted": false,
"_maxOperationRetryTime": 120000,
"_maxUploadRetryTime": 600000,
"_requests": {}
},
"_location": {
"bucket": "xxxxxxxxxx",
"path_": "samples/coming to an end v2.mp3.asd"
}
},
"storage": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxx",
"authDomain": "xxxxxx",
"projectId": "xxxxx",
"storageBucket": "xxxxx",
"messagingSenderId": "xxxxx",
"appId": "xxxx"
}
},
"_delegate": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxxxxxxxxxx",
"authDomain": "xxxxxxx",
"projectId": "xxxxxx",
"storageBucket": "xxxxx",
"messagingSenderId": "xxxxx",
"appId": "xxxxxx"
}
},
"_authProvider": {
"name": "auth-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": {
"name": "auth-internal",
"multipleInstances": false,
"instantiationMode": "LAZY",
"type": "PRIVATE"
},
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_appCheckProvider": {
"name": "app-check-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": null,
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_pool": {},
"_firebaseVersion": "8.6.5",
"_bucket": {
"bucket": "megatech-ltd.appspot.com",
"path_": ""
},
"_host": "firebasestorage.googleapis.com",
"_appId": null,
"_deleted": false,
"_maxOperationRetryTime": 120000,
"_maxUploadRetryTime": 600000,
"_requests": {}
},
"INTERNAL": {}
}
}
如firebase存储api文档中所述,
list()
返回一个值,该值可能包含多个对象
如果要获取由
list()
返回的所有对象的元数据,则需要调用每个返回的文件。是否可以在循环中调用console.log(item)
,并在问题中包含更新的代码及其输出?@FrankvanPuffelen我在描述中添加了该对象的一个实例-谢谢。
ReferenceCompat: {
"_delegate": {
"_service": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxxx-xxxxxxxxx",
"authDomain": "xxxxxx",
"projectId": "xxxx",
"storageBucket": "xxxxxx",
"messagingSenderId": "xxxxxxxxx",
"appId": "xxxxxxxx"
}
},
"_authProvider": {
"name": "auth-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": {
"name": "auth-internal",
"multipleInstances": false,
"instantiationMode": "LAZY",
"type": "PRIVATE"
},
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_appCheckProvider": {
"name": "app-check-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": null,
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_pool": {},
"_firebaseVersion": "8.6.5",
"_bucket": {
"bucket": "xxxxx",
"path_": ""
},
"_host": "firebasestorage.googleapis.com",
"_appId": null,
"_deleted": false,
"_maxOperationRetryTime": 120000,
"_maxUploadRetryTime": 600000,
"_requests": {}
},
"_location": {
"bucket": "xxxxxxxxxx",
"path_": "samples/coming to an end v2.mp3.asd"
}
},
"storage": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxx",
"authDomain": "xxxxxx",
"projectId": "xxxxx",
"storageBucket": "xxxxx",
"messagingSenderId": "xxxxx",
"appId": "xxxx"
}
},
"_delegate": {
"app": {
"name": "[DEFAULT]",
"automaticDataCollectionEnabled": false,
"options": {
"apiKey": "xxxxxxxxxxxxxx",
"authDomain": "xxxxxxx",
"projectId": "xxxxxx",
"storageBucket": "xxxxx",
"messagingSenderId": "xxxxx",
"appId": "xxxxxx"
}
},
"_authProvider": {
"name": "auth-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": {
"name": "auth-internal",
"multipleInstances": false,
"instantiationMode": "LAZY",
"type": "PRIVATE"
},
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_appCheckProvider": {
"name": "app-check-internal",
"container": {
"name": "[DEFAULT]",
"providers": {}
},
"component": null,
"instances": {},
"instancesDeferred": {},
"onInitCallbacks": {}
},
"_pool": {},
"_firebaseVersion": "8.6.5",
"_bucket": {
"bucket": "megatech-ltd.appspot.com",
"path_": ""
},
"_host": "firebasestorage.googleapis.com",
"_appId": null,
"_deleted": false,
"_maxOperationRetryTime": 120000,
"_maxUploadRetryTime": 600000,
"_requests": {}
},
"INTERNAL": {}
}
}