Here is the relevant code:
app.get('/all', function(req,res) {
Party.find({},[],function(p) {
console.log(p);
});
res.redirect('/');
});
should return all collections from the database - returns null in the console.
var mongoose = require('mongoose');
var db = mongoose.connect('mongodb://localhost/impromptu');
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
initialization overview
var PartySchema = new Schema({
what : String,
when : String,
where : String
});
mongoose.model('Party',PartySchema);
var Party = db.model('Party');
scheme
I have everything that is necessary for the correct configuration, I can save collections just fine, I can’t get everything for some reason ...
Checked / var / log / mongodb.log and this is really a connection.
Any ideas?
source
share