相关疑难解决方法(0)

什么是Mongoose(Nodejs)复数规则?

我是Node.js,Mongoose和Expressjs的新手.我试图通过以下代码在MongoDB中使用Mongoose创建一个表"feedbackdata".但它被创建为"feedbackdata*s*".通过谷歌搜索,我发现Mongoose使用复数规则.有人请帮我删除复数规则吗?或者我的代码应该如何用于"feedbackdata"表?

以下是我的代码:

app.post("/save",function(req,res){

mongoose.connect('mongodb://localhost/profiledb');

mongoose.connection.on("open", function(){
    console.log("mongo connected \n");
});

// defining schemar variables
Schema = mongoose.Schema,   
ObjectId = Schema.ObjectId;

// define schema for the feedbackdata table
var feedback_schema = new Schema({
    _id: String,
    url:String,
    username:String,
    email:String,
    subscribe:String,
    types:String,
    created_date: { type: Date, default: Date.now },
    comments: String
});

// accessing feeback model object
var feedback_table = mongoose.model('feedbackdata', feedback_schema);
var tableObj = new feedback_table();

var URL = req.param('url');
var name = req.param('name');
var email = req.param('email');
var subscribe …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js

13
推荐指数
2
解决办法
5494
查看次数

标签 统计

mongodb ×1

mongoose ×1

node.js ×1