![](/img/trans.png)
[英]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.