【发布时间】:2019-10-29 06:58:06
【问题描述】:
是否可以将猫鼬大数据存储到多个文档中但应该在一个集合下
例如
-->Collection --> 客户,它有基于 ObjectId 的文档。
所以我正在寻找的是可以将数据存储到多个文档中,但所有这些都应该链接在一起吗?我的问题是我的服务器“当客户提出非常大的请求并保存数据时抛出错误,所以我需要解决方案来存储大数据。
drives:[{
name:string,
driveID:string,
phases:[] // this contain sub arrays and can be upto 20k lines of JSON because it contains a questionnaire
}]
例如
"phases":[
{
"phase":"abc"
"phase" : "driveOne",
"text" : "Drive One",
"textKey" : "",
"index" : "1.0",
"subjects":[
"id:"1.1.1",
"text":"test",
"textKey":"",
]
},
// for demo purpose I am copying same data...
{
"phase":"abc"
"phase" : "driveOne",
"text" : "Drive One",
"textKey" : "",
"index" : "1.0",
"subjects":[
"id:"1.1.1",
"text":"test",
"textKey":"",
]
},
{
"phase":"abc"
"phase" : "driveOne",
"text" : "Drive One",
"textKey" : "",
"index" : "1.0",
"subjects":[
"id:"1.1.1",
"text":"test",
"textKey":"",
]
},
{
"phase":"abc"
"phase" : "driveOne",
"text" : "Drive One",
"textKey" : "",
"index" : "1.0",
"subjects":[
"id:"1.1.1",
"text":"test",
"textKey":"",
]
},
]
【问题讨论】:
-
您的数据是否有
_id或者您不关心_id。 -
不在模型中,但是是的,我可以使用 _id 访问文档
-
能否提供数据?那是大吗?我想看看结构。
-
Okkk 会尽快回复您。
-
你得到什么错误?