无法更新猫鼬混合架构类型

时间:2019-01-17 00:19:35

标签: node.js mongodb mongoose

// this properly updates my object
 req.user.scienceViewsData = {
   'asdf' : {
     one: 'asdf',
     two: 'asdf'
   }
 }

// why doesn't this work?
 req.user.scienceViewsData['asdf'] = {
     one: '1234',
     two: '1234'
 };

await req.user.save();

使用架构类型混合。为什么这行不通?

0 个答案:

没有答案
相关问题