MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

lancia nuovo mongoose.Error.MissingSchemaError(name); ^ MongooseError:Schema non è stato registrato per il commerciante modello

dichiarare il mongoose.connect sopra le importazioni del modello

var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var mongoose = require('mongoose')

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


var MerchantModel = require('./models/merchant');

//  var mongoose = require('mongoose').model('merchant');
var index = require('./routes/index');
var merchant = require('./routes/merchant');


var app = express();