{
"_id" : 3,
"label" : "径前肌",
"files" : [
{
"id" : "8eb7d8fe-de08-446d-802e-3a25743fa137",
"filename" : "ybl_20190605_1559700070044.kfb",
"info" : "/images/ybl_20190605_1559700070044.kfb_labelinfo.jpg",
"preview" : "/images/ybl_20190605_1559700070044.kfb_priview.jpg",
"viewer" : "/viewer?name=ybl_20190605_1559700070044d.kfb",
"dzi" : "/images/ybl_20190605_1559700070044.kfb.dzi",
"scale" : "/images/info/ybl_20190605_1559700070044.kfb",
"saveUser" : "JKZwSny9vvHDFsTYD",
"saveHospital" : "上海市闵行区浦江镇浦江卫生院",
"createAt" : 1559700328326.0,
"updateAt" : 1559700328326.0,
"status" : 0,
"annotationsUsers" : []
}
]
}
这是当前mongo中的数据结构现在想在annotationsUsers这个数组中存入以下对象,应该怎么做,根据_id和id了
{
"createAt": "",
"saveUser": "",
"result": "",
"annotations": [
{
"image": "",
"createAt": "",
"points": [],
}
现在这样写的
dbo.collection('AnnotationFileGroups').update({_id:groupId},{id:fileId}, {$addToSet: {annotationsUsers: newFile}}, e => {
if(e) throw e;
res.json({
code: 200,
data: {
id: newFile.saveUser,
},
});
现在存储完结构是错误的,应该怎么改?