3

I am using mongodb and mongoose for my database. How can I retrieve data from mongodb using nodejs and display the contents in an ejs page? I have searched a lot and I still couldn't find the solution.

This is my Schema

var mongoose = require("mongoose");

 var Schema = mongoose.Schema;

 var UserSchema = new Schema({

     username:String,
     _id:String,
     dateOfBirth:Date,
     telephoneNo:Number,
     address:String,
     email:String,
     fb_Id:String,
     jobTitle:String,
     password:String
 });

 module.exports=mongoose.model('User',UserSchema);
Sumeet Kumar Yadav
  • 11,912
  • 6
  • 43
  • 80
Kabilesh
  • 1,000
  • 6
  • 22
  • 47

0 Answers0