车把猫鼬表达

时间:2017-09-28 09:29:39

标签: mongoose view handlebars.js

我完全是bignner我在mongo db中的数据是我想逐一提取。我能够解决问题和答案,但我如何从访问中获取数据[] plz帮助我

{
    "_id" : ObjectId("59c6442cdbaab553cae9913d"),
    "Qno" : 1,
    "Question" : "who u rqqqqqqqqqqqqqqq",
    "Answer" : "fineqqqqqqqqqqq",
    "answerr" : {
        "option" : "hi i ",
        "option" : "hi i "
    },
    "access" : [ 
        {
            "id" : "1",
            "name" : "Printer"
        }, 
        {
            "id" : "3",
            "name" : "Desktop"
        }, 
        {
            "id" : "4",
            "name" : "VMs"
        }
    ]
}

我有关于mongodb的数据,我想从中获取数据,所以我使用

    router.get('/', function(req, res, next) {
    // res.render('index');
    UserData.find()
        .then(function(doc) {
            //res.json({ 'items': doc });
            res.render('rnglishonelinear', { 'items': doc });

        });
    console.log('hiu');

});

处理它的把手

<section class="get2" draggable="true" (click)="">

    {{# each items as |p index|}}          

                {{p.access.name}}
                    <br>
                    {{Question}}

                  <br>option:{{item.access.name}}
                name::    {{this.access}}

{{#each access}}
  {{@key}}: {{this}}
{{/each}}

0 个答案:

没有答案