title: How expose data from server to client
body: <p>I'm new with node.js. I'm writing a single rest API and I want to know what is the right way to expose data without expose unnecessary information.</p>
  
  <p>In my example, I have a "Tag" schema. And I don't want to expose the mongoose fields to my client. My code:</p>
  
  <pre><code>apiRoutes.get('/tag', passport.authenticate('jwt', {
      session: false
  }), (req, res) =&gt; {
      Tag.find({}, (err, tags) =&gt; {
          return res.json(tags);
      });
  });
  </code></pre>
  
  <p>But in client, I don't want to expose "_id" and "__v":</p>
  
  <pre><code>{
          "_id": "57083a5e725f3cf0242a2916",
          "tagName": "Test",
          "en_us": "Testing",
          "__v": 0,
          "lastUpdated": "2016-04-08T23:10:22.759Z"
      }
  </code></pre>
  
  <p>What is the right way to map only relevant fields?</p>