title: How to store data as type number in mongodb using sails.js
body: <blockquote>
    <p>Problem : How to store data as type number in mongodb using sails.js</p>
  </blockquote>
  
  <p>I am storing some record in mongodb using sails.js</p>
  
  <p>name as string
  mobile as number, i'm converting mobile from sting to number as     </p>
  
  <pre><code>mobile = parseInt(mobile)
  </code></pre>
  
  <p>Model Definition</p>
  
  <pre><code>    mobile : {
        type: 'number',
        unique: true,
      } 
  </code></pre>
  
  <p>It should looks like</p>
  
  <pre><code>{
    "name":"abc",
    "mobile":123456789 // Number
  }
  </code></pre>
  
  <p>But after inserting record it looks like this as mobile type is double</p>
  
  <pre><code>{
    "name":"abc",
    "mobile":123456789.000000 // Double
  }
  </code></pre>
  
  <p>How to convert mobile value form string to integer value ie. number in mongodb.</p>
  
  <p>Thanks </p>