title: How to convert MongooseMap to JSON object to send it from Node js to React?
body: <p>In mongoose, there is <a href="https://mongoosejs.com/docs/schematypes.html#maps" rel="nofollow noreferrer">Map data type</a> that allows to store arbitrary keys.
  I understand that to get and set values I should use <code>get</code> and <code>set</code> methods. However, when I send an object to frontend, Nodejs sends just empty JSON object. 
  Is there a way to automatically convert Mongoose object, that has Map type, into JSON object to send over the network, without extracting every key with <code>get</code> on the backend?</p>
  
  <p>My model:</p>
  
  <pre><code>var  mongoose = require('mongoose');
  
  var User = require('./user');
  var Post = require('./post');
  const Schema = mongoose.Schema;
  const ObjectId = mongoose.Schema.Types.ObjectId;
  
  const DescriptionSchema = new Schema({
      timeStamp: {type: Date, default: Date.now},
      postid: {type: ObjectId, ref: 'Post'},
      userid: {type: ObjectId, ref: 'User'},
      dstrings:{
          type: Map,
          of: String// key value
        }
  });
  
  module.exports = mongoose.model('Description', DescriptionSchema);
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>// '/v1/description/add'
      api.post('/add', authenticate,(req, res) =&gt; {
          let description = new Description({         
              postid: ObjectId(req.body.postid),
              userid: ObjectId(req.user.id), 
              dstrings:req.body.dstrings,
  
          });
          description.save(function(err, description) {
              if (err) {
                  res.status(500).json({ message: err });
              } else {
  //  description.dstrings is equal to {} on the frontend               
                      res.status(200).json( description );
                  }
              });  
          });
  </code></pre>
  
  <p>JSON.stringify didn't work; I checked database, it has the value. </p>