mongo db aggregate procsess , user info (about...)

Viewed 18

I'm making a question and answer site using node js, which I leave the model down. How should I go about updating the section about the user profile? If I use the user object, it thinks it's registration again. how can i do aggregate so the example user entered an entry, I want to store that entry in the user model as entry id, how can I do it?

const entry = new mongoose.Schema({
  title: {
    type: String,
    required: true,
  },
  date: {
    type: Date,
    default: Date.now,
  },

  popular: {
    type: String,
    value: 1,
  },
  entry: {
    type: String,
    required: true,
    min: [2, "En az 3 karakter "],
  },
  like: {
    type: Number,
  },
  id: { type: String },
  author: {
    type: String,
    required: true,
  },
  authorId: { type: String, required: true },
  token: { type: String },
});
0 Answers
Related