如何在spring-boot mongodb中更新子子文档?

时间:2018-07-24 13:26:10

标签: java mongodb spring-boot nosql

{ 
    "refNum" : "ESMEUS", 
    "faqs" : [
        {
            "type" : "about company", 
            "answer" : "xxxxxxxxxxxxxxx", 
            "questions" : [
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }
            ]
        }, 
        {
            "type" : "about ceo", 
            "answer" : "xxxxxxxxxxxxxxx", 
            "questions" : [
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }
            ]
        }, 
        {
            "type" : "about salary", 
            "answer" : "xxxxxxxxxxxxxxx", 
            "questions" : [
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }
            ]
        }, 
        {
            "type" : "awards", 
            "answer" : "xxxxxxxxxxxxxxx", 
            "questions" : [
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }, 
                {
                    "question" : "tell me abt company"
                }
            ]
        }
    ]
}

如何为“类型”:“关于公司”添加新问题 我需要在春季启动MongoDB中对此进行查询。

0 个答案:

没有答案