Bruce Gust
asked on
Why Doesn't This Collection Automatically Show Up in my MongoDB?
Here's a portion of my app.js file:
Here's my "auth.js" model:
I'm expecting to see a new "auth" collection in my MongoDB but I'm not seeing it.
Am I missing something?
const express = require("express");
const jwt = require("jsonwebtoken"); //this is the package that decrypts your token
const mongoose = require("mongoose");
//const compression = require("compression");
const app = express();
const superPassword = process.env.SIGNATURE; //here's where you're grabbing your SIGNATURE constant from your .env file that's in your root directory
const conn = process.env.CONNECTION;
const Auth = require("./models/auth");
Here's my "auth.js" model:
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const authSchema = new Schema({
app: {
type: String,
required: true
},
token: {
type: String,
required: true
}
});
module.exports = mongoose.model("Auth", authSchema);
I'm expecting to see a new "auth" collection in my MongoDB but I'm not seeing it.
Am I missing something?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
BOOM!
no problem. thanx.
ASKER