We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.
const mongoose = require('mongoose');
const userSchema = new mongoose.Schema({
fstName: String,
lstName: String,
email: String
});
const User = mongoose.model('User', userSchema);
module.exports = User;
const User = require('./user.model');
const getUserList = async () => {
try {
const users = await User.find();
console.log('User List: ', users);
} catch(e) {
throw new Error(e);
}
}
module.exports = {getUserList}