title: NativeScript and mongodb integration
body: <p>I have created a simple nativescript application which works fine without interacting with any database. I have reached a point where I need to get/put data from MongoDB. </p>
  
  <p>So I have built a MongoDB framework with the help of <a href="https://mlab.com/" rel="nofollow noreferrer">https://mlab.com/</a> which works great as expected using nodeJS modules.</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var bodyparser = require('body-parser');
  var mongoose = require('mongoose');
  var MongoClient = require('mongodb').MongoClient
   , assert = require('assert');
  
  var MongoClient = require('mongodb').MongoClient
   , assert = require('assert');
  
  // Connection URL
  var url = 'mongodb://user:password@ds145329.mlab.com:12345/dbname';
  // Use connect method to connect to the Server
  MongoClient.connect(url, function(err, db) {
    // CRUD Operation goes here...
  });
  </code></pre>
  
  <p>Now I need to integrate the MongoDB framework with the nativescript application that I created. </p>
  
  <p>The question is if I will be able to <strong><em>require</em></strong> the nodeJS libraries inside NativeScript? If yes, how?</p>
  
  <p>Thank you for helping,</p>
  
  <p>Seyed Ismail MAC.</p>