URL未命中服务器(mongodb)

时间:2016-05-24 05:39:50

标签: angularjs mongodb

我想根据我作为参数发送到服务器的quesListName从我的集合中获取对象 这是我的服务

angular.module('hrPortalApp')
.service('getCandidateInterviewListService', function($http, ajaxServiceManager) {        
    var sUrlQuestions = "http://localhost:4000/onboardvue/questions/qListQuestions/";        
    return {

        fnGetQuestions: function(qListName) {
            return ajaxServiceManager.fnQuery({
                sUrl: sUrlQuestions,
                sMethod: "GET",
                oData: null,
                oParams: {
                    quesListName: qListName
                }
            });
        },
    };
});

下面是我的架构

var QuestionsSchema = new Schema({
topicName: String,
quesListName: String,
question:String

});

我写的基于quesListName获取对象的查询是

exports.query = function(req, res) {
Questions.find({quesListName:req.query.quesListName}, function(err, questions) {
    if (err) {
        return handleError(res, err);
    }
    return res.status(200).json(fnData(questions));
});

};

但我得到500错误

0 个答案:

没有答案