超过FireMB 1MB

编程入门 行业动态 更新时间:2024-10-10 18:22:39
本文介绍了超过FireMB 1MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我将旅行历史记录(数组映射)存储在Firestore上.尝试存储较大的数组映射(数组长度可能超过10,000)时,该应用程序崩溃了(Flutter应用程序).并且同一文档上有30多个字段.

I'm storing trip history (array-map) on firestore. the app is crash (Flutter app) when trying to store a large array map (array length may be more than 10,000). and also there are more than 30 fields on the same doc.

这是我的地图(地图列表).

this is my map(list of map).

Map<String, dynamic> toMap() => { "latitude": latitude, "longitude": longitude, "accuracy": accuracy, "altitude": altitude, "speed": speed, "speed_accuracy": speedAccuracy, "heading": heading, "time": time, };

有什么解决方案可以将这种数组存储在Firestore上吗?

Is there any solution to store this kind of array on firestore?

推荐答案

在Firestore中,不能超过文档的最大大小.

It's not possible to exceed the max size of a document in Firestore.

您应该做的是将每一项数据拆分到自己的文档中,可能在嵌套在主文档下的子集合中.

What you should do instead is split each item of data into its own document, probably in a subcollection nested under a primary document.

更多推荐

超过FireMB 1MB

本文发布于:2023-11-29 15:56:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646866.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:FireMB   MB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!