const mongoose = require("mongoose");
//const { Schema } = mongoose;
mongoose.Promise = global.Promise;
const Schema = mongoose.Schema;
const postingSchema = mongoose.Schema({
  title: {
    type: String,
  },
  description: {
    type: String,
    required: true,
  },
  postImage: {
    type: String,
  },

  date: {
    type: String,
  },
  uid: {
    type: String,
  },
  user: { 
    type: mongoose.Schema.Types.ObjectId, 
    ref: "user" 
  },
  userId: {
    type: String,
  },
  stat: {
    type: String,
  },
});

module.exports = mongoose.model("post", postingSchema);
