Consider these 3 schemas and hierarchy: A Project has multiple Stages, a Stage has multiple Events. For pushing a new Stage into a Project, I do this:
Project.findOneAndUpdate(
      { slug: projectSlug },
      { $push: { stages: myNewStage } },
    ).then((post) => res.status(201).json({
      message: 'stage created successfully',
      data: post,
    })).catch((error) => {
      return res.status(500).json({
        code: 'SERVER_ERROR',
        description: 'something went wrong, Please try again',
      });
    });
But, how can I push a new event into a Stage? As far as I've seen, a subdocument does not have the same properties as a document (such as find, findAndUpdate).
My actual schemas:
PROJECT SCHEMA
const mongoose = require('mongoose');
const Stage = require('./Stages').model('Stages').schema;
const projectSchema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
  },
  description: {
    type: String,
  },
  slug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
    unique: true,
  },
  clientSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  stages: [Stage],
  startDate: {
    type: Date,
    trim: true,
    required: true,
  },
  endDate: {
    type: Date,
    trim: true,
    required: false,
  },
},
  {
    timestamps: true,
  });
module.exports = mongoose.model('Projects', projectSchema);
STAGE SCHEMA
const mongoose = require('mongoose');
const Event = require('./Events').model('Events').schema;
const stageSchema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
  },
  description: {
    type: String,
  },
  slug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
    unique: true,
  },
  clientSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  projectSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  events: [Event],
},
  {
    timestamps: true,
  });
module.exports = mongoose.model('Stages', stageSchema);
EVENT SCHEMA
const mongoose = require('mongoose');
const Comment = require('./Comments').model('Comments').schema;
const eventSchema = new mongoose.Schema({
  _id: {
    type: String,
    trim: true,
    lowercase: true,
  },
  userEmail: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  text: {
    type: String,
  },
  imgUrl: {
    type: String,
  },
  documentUrl: {
    type: String,
  },
  stageSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  clientSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  projectSlug: {
    type: String,
    trim: true,
    required: true,
    lowercase: true,
  },
  comments: [Comment],
},
  {
    timestamps: true,
  });
module.exports = mongoose.model('Events', eventSchema);
 
    