title: How to add save another Schema data to a model?
body: <p>I am using mongoose with Mongodb v3.4.3</p>
  
  <p>Below is my image model code</p>
  
  <pre><code>const mongoose = require("mongoose");
  const CoordinateSchema = require("./coordinate");
  
  const ImageSchema = new mongoose.Schema({
      image_filename: {
          type: String,
          required: true
      },
      image_url: {
          type: String,
          required: true
      },
      coordinates: [CoordinateSchema],
  });
  </code></pre>
  
  <p>Below is my CoordinateSchema code</p>
  
  <pre><code>const mongoose = require("mongoose");
  
  const CoordinateSchema = new mongoose.Schema({
      coordinates : {
          type: Array,
          default: [],
      }
  });
  
  module.exports =  CoordinateSchema;
  </code></pre>
  
  <p>Below is my api js code running on express, </p>
  
  <pre><code>    router.post('/receiveCoordinates.json', (req, res, next) =&gt; {
  
          Image.findOneAndUpdate({image_filename:req.body.file_name}).then((image) =&gt;    {
  
  
         })
      });
  </code></pre>
  
  <p>How to finish this code  so I can store coordinates data in Image model.</p>
  
  <p>Thanks.</p>