gpt4 book ai didi

azure - Azure Cosmos DB 中存储的单个文档的大小限制是多少

转载 作者:行者123 更新时间:2023-12-02 23:42:02 27 4
gpt4 key购买 nike

我在 Azure 中有一个 MongoDB 数据库(在 Cosmos DB 帐户下注册),并且我在 ms docs 上读到每个存储文档的大小限制为 2MB。但是,当我尝试存储大约 1.7 MB 的图像缓冲区时,出现以下错误:

2019-11-01T00:43:14.057681416Z { MongoError: Message: {"Errors":["Request size is too large"]}
2019-11-01T00:43:14.057757320Z RequestStartTime: 2019-11-01T00:43:13.9695930Z, RequestEndTime: 2019-11-01T00:43:13.9995776Z, Number of regions attempted:1
2019-11-01T00:43:14.057768921Z ResponseTime: 2019-11-01T00:43:13.9995776Z, StoreResult: StorePhysicalAddress: rntbd://cdb-ms-prod-centralus1-fd19.documents.azure.com:14112/apps/0806fa15-6a2d-4127-a73b-b1626ddd8af1/services/5618d8a3-dc06-4e8a-ba18-39d3b0c58add/partitions/d61f7139-78bf-423b-a4d7-747179270393/replicas/132167814077711166p/, LSN: -1, GlobalCommittedLsn: -1, PartitionKeyRangeId: , IsValid: True, StatusCode: 410, SubStatusCode: 0, RequestCharge: 0, ItemLSN: -1, SessionToken: , UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Create
2019-11-01T00:43:14.057779921Z SDK: Microsoft.Azure.Documents.Common/2.7.0
2019-11-01T00:43:14.057788121Z at Function.create (/home/site/wwwroot/node_modules/mongodb/lib/core/error.js:44:12)
2019-11-01T00:43:14.057796322Z at toError (/home/site/wwwroot/node_modules/mongodb/lib/utils.js:150:22)
2019-11-01T00:43:14.057804822Z at coll.s.topology.insert (/home/site/wwwroot/node_modules/mongodb/lib/operations/common_functions.js:266:39)
2019-11-01T00:43:14.057813223Z at handler (/home/site/wwwroot/node_modules/mongodb/lib/core/sdam/topology.js:1000:24)
2019-11-01T00:43:14.057821223Z at wireProtocol.(anonymous function) (/home/site/wwwroot/node_modules/mongodb/lib/core/sdam/server.js:457:5)
2019-11-01T00:43:14.057829423Z at /home/site/wwwroot/node_modules/mongodb/lib/core/connection/pool.js:408:18
2019-11-01T00:43:14.057837624Z at process._tickCallback (internal/process/next_tick.js:61:11)
2019-11-01T00:43:14.057845624Z driver: true,
2019-11-01T00:43:14.057853424Z name: 'MongoError',
2019-11-01T00:43:14.057861125Z index: 0,
2019-11-01T00:43:14.057868725Z code: 16,
2019-11-01T00:43:14.057876326Z errmsg:
2019-11-01T00:43:14.057886326Z 'Message: {"Errors":["Request size is too large"]}\r\n, RequestStats: \r\nRequestStartTime: 2019-11-01T00:43:13.9695930Z, RequestEndTime: 2019-11-01T00:43:13.9995776Z, Number of regions attempted:1\r\nResponseTime: 2019-11-01T00:43:13.9995776Z, LSN: -1, GlobalCommittedLsn: -1, PartitionKeyRangeId: , IsValid: True, StatusCode: 410, SubStatusCode: 0, RequestCharge: 0, ItemLSN: -1, SessionToken: , UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Create\r\n, SDK: Microsoft.Azure.Documents.Common/2.7.0',
2019-11-01T00:43:14.057902127Z [Symbol(mongoErrorContextSymbol)]: {} }

目前,我订阅的是 Azure for Students,并且我一直使用免费套餐来获取所有资源。我还在 this documentation 中阅读了有关存储和吞吐量的内容,但我不确定必须修改哪些内容才能正常工作。

有人可以建议一下吗?

最佳答案

文档的最大大小为 2 MB,且无法增加。在您的情况下,您可以将图像存储在 blob 存储中,并将 url 作为属性附加到您要保存的文档,这将节省一些字节。

关于azure - Azure Cosmos DB 中存储的单个文档的大小限制是多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58653153/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com