-1

I've stuck for 3 hours wrong and couldn't solve this issue. I'm getting nothing from my document.

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var accountSchema = mongoose.Schema({
    username: String,
    salt: String,
    hash: String,
    cover: String,
    createAt: {type: Date, default: Date.now},
    subscriber_email: String
});

module.exports = mongoose.model('account', accountSchema);

I tested with other schema they all worked but not this one. My data's like below

enter image description here

Maria Jane
  • 2,353
  • 6
  • 23
  • 39

1 Answers1

0

I think the reason you are not able to view anything in your document is the way you are exporting the accountSchema.

Try replacing Account with account while exporting the schema.

Try this:

module.exports = mongoose.model('Account', accountSchema);

Everything else looks fine.

I hope this helps.

Ravi Shankar Bharti
  • 8,922
  • 5
  • 28
  • 52