通过mongoose更改文档中数组中的数组

时间:2016-12-04 09:01:46

标签: arrays node.js mongodb mongoose mongoose-schema

我有这样的架构:

username: String,
authData: socialNetworkName: {
        access_token: String,
        expiration_date: Date,
        id: String
    }

使用它的例子:

"name" : "Ilya",
"authData" : {
    "fb" : {
        "access_token" : "ECBAI3easd64T4dEokBaANN",
        "expiration_date" : ISODate("2017-02-01T18:55:07Z"),
        "id" : "4314342324242424242"
    },
    "twitter": {
        "access_token":"fdfkdlfdfdfkdl",
        "expiration_date":ISODate("2017-02-01T18:55:07Z",
        "id":"343243434"
    }
},

如何在fb中访问authData以更新访问令牌而不更改'twitter'?

0 个答案:

没有答案