[英]how to get all the documents that are matching the fields in mongodb using mongoose by using search operation with multiple fields in nodejs
[英]google docs api documents.get multiple fields ? (nodejs)
使用documents.get時如何 select 多個字段?
現在我得到這樣的文件:
const doc = await docs.documents.get({
documentId: copiedFile.data.id,
fields: 'body/content'
});
它返回這個:
"data": {
"body": {
"content": [...]
}
}
但是,我還需要獲取inlineObject
,到目前為止,我能夠這樣做的唯一方法是完全刪除fields
proeprty
const doc = await docs.documents.get({
documentId: copiedFile.data.id,
});
然后我得到這個:
"data": {
"title": "Some document title",
"body": {
"content": [...]
},
"headers": {
},
"footers": {
},
"documentStyle": {
},
"namedStyles": {
},
"lists": {
},
"revisionId": "some-long-id",
"suggestionsViewMode": "SUGGESTIONS_INLINE",
"inlineObjects": {
},
"documentId": "some-long-id"
}
但是我真的只對data.body.content
和data.inlineObjects
選擇所有內容時,響應是數千行Z466DEEC76ECDF5F5FCA6D38571F6324D54Z較大,我不想要。
我已經嘗試過fields: ['body/content', 'inlineObjects']
但它只返回body.content
而不是inlineObjects
- 而且文檔也沒有在任何地方提到這種語法,它只是為了試驗。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.