http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/lib/mongodb/mongo_client.js
----------------------------------------------------------------------
diff --git a/web/demos/package/node_modules/mongodb/lib/mongodb/mongo_client.js 
b/web/demos/package/node_modules/mongodb/lib/mongodb/mongo_client.js
deleted file mode 100644
index 0b855b3..0000000
--- a/web/demos/package/node_modules/mongodb/lib/mongodb/mongo_client.js
+++ /dev/null
@@ -1,441 +0,0 @@
-var Db = require('./db').Db
-  , Server = require('./connection/server').Server
-  , Mongos = require('./connection/mongos').Mongos
-  , ReplSet = require('./connection/repl_set/repl_set').ReplSet
-  , ReadPreference = require('./connection/read_preference').ReadPreference
-  , inherits = require('util').inherits
-  , EventEmitter = require('events').EventEmitter
-  , parse = require('./connection/url_parser').parse;
-
-/**
- * Create a new MongoClient instance.
- *
- * Options
- *  - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern 
for the operation where < 1 is no acknowlegement of write and w >= 1, w = 
'majority' or tag acknowledges the write
- *  - **wtimeout**, {Number, 0} set the timeout for waiting for write concern 
to finish (combines with w option)
- *  - **fsync**, (Boolean, default:false) write waits for fsync before 
returning
- *  - **journal**, (Boolean, default:false) write waits for journal sync 
before returning
- *  - **readPreference** {String}, the prefered read preference 
(ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, 
ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, 
ReadPreference.NEAREST).
- *  - **native_parser** {Boolean, default:false}, use c++ bson parser.
- *  - **forceServerObjectId** {Boolean, default:false}, force server to create 
_id fields instead of client.
- *  - **pkFactory** {Object}, object overriding the basic ObjectID primary key 
generation.
- *  - **serializeFunctions** {Boolean, default:false}, serialize functions.
- *  - **raw** {Boolean, default:false}, peform operations using raw bson 
buffers.
- *  - **recordQueryStats** {Boolean, default:false}, record query statistics 
during execution.
- *  - **retryMiliSeconds** {Number, default:5000}, number of miliseconds 
between retries.
- *  - **numberOfRetries** {Number, default:5}, number of retries off 
connection.
- *  - **bufferMaxEntries** {Boolean, default: -1}, sets a cap on how many 
operations the driver will buffer up before giving up on getting a working 
connection, default is -1 which is unlimited
- * 
- * Deprecated Options 
- *  - **safe** {true | {w:n, wtimeout:n} | {fsync:true}, default:false}, 
executes with a getLastError command returning the results of the command on 
MongoDB.
- *
- * @class Represents a MongoClient
- * @param {Object} serverConfig server config object.
- * @param {Object} [options] additional options for the collection.
- */
-function MongoClient(serverConfig, options) {
-  if(serverConfig != null) {
-    options = options == null ? {} : options;
-    // If no write concern is set set the default to w:1
-    if(options != null && !options.journal && !options.w && !options.fsync) {
-      options.w = 1;
-    }
-    
-    // The internal db instance we are wrapping
-    this._db = new Db('test', serverConfig, options);    
-  }
-}
-
-/**
- * @ignore
- */
-inherits(MongoClient, EventEmitter);
-
-/**
- * Connect to MongoDB using a url as documented at
- *
- *  docs.mongodb.org/manual/reference/connection-string/
- *
- * Options
- *  - **uri_decode_auth** {Boolean, default:false} uri decode the user name 
and password for authentication
- *  - **db** {Object, default: null} a hash off options to set on the db 
object, see **Db constructor**
- *  - **server** {Object, default: null} a hash off options to set on the 
server objects, see **Server** constructor**
- *  - **replSet** {Object, default: null} a hash off options to set on the 
replSet object, see **ReplSet** constructor**
- *  - **mongos** {Object, default: null} a hash off options to set on the 
mongos object, see **Mongos** constructor**
- *
- * @param {String} url connection url for MongoDB.
- * @param {Object} [options] optional options for insert command
- * @param {Function} callback this will be called after executing this method. 
The first parameter will contain the Error object if an error occured, or null 
otherwise. While the second parameter will contain the initialized db object or 
null if an error occured.
- * @return {null}
- * @api public
- */
-MongoClient.prototype.connect = function(url, options, callback) {
-  var self = this;
-
-  if(typeof options == 'function') {
-    callback = options;
-    options = {};
-  }
-
-  MongoClient.connect(url, options, function(err, db) {
-    if(err) return callback(err, db);
-    // Store internal db instance reference
-    self._db = db;
-    // Emit open and perform callback
-    self.emit("open", err, db);
-    callback(err, db);
-  });
-}
-
-/**
- * Initialize the database connection.
- *
- * @param {Function} callback this will be called after executing this method. 
The first parameter will contain the Error object if an error occured, or null 
otherwise. While the second parameter will contain the connected mongoclient or 
null if an error occured.
- * @return {null}
- * @api public
- */
-MongoClient.prototype.open = function(callback) {
-  // Self reference
-  var self = this;
-  // Open the db
-  this._db.open(function(err, db) {
-    if(err) return callback(err, null);
-    // Emit open event
-    self.emit("open", err, db);
-    // Callback
-    callback(null, self);
-  })
-}
-
-/**
- * Close the current db connection, including all the child db instances. 
Emits close event if no callback is provided.
- *
- * @param {Function} callback this will be called after executing this method. 
The first parameter will contain the Error object if an error occured, or null 
otherwise. While the second parameter will contain the results from the close 
method or null if an error occured.
- * @return {null}
- * @api public
- */
-MongoClient.prototype.close = function(callback) {
-  this._db.close(callback);
-}
-
-/**
- * Create a new Db instance sharing the current socket connections.
- *
- * @param {String} dbName the name of the database we want to use.
- * @return {Db} a db instance using the new database.
- * @api public
- */
-MongoClient.prototype.db = function(dbName) {
-  return this._db.db(dbName);
-}
-
-/**
- * Connect to MongoDB using a url as documented at
- *
- *  docs.mongodb.org/manual/reference/connection-string/
- *
- * Options
- *  - **uri_decode_auth** {Boolean, default:false} uri decode the user name 
and password for authentication
- *  - **db** {Object, default: null} a hash off options to set on the db 
object, see **Db constructor**
- *  - **server** {Object, default: null} a hash off options to set on the 
server objects, see **Server** constructor**
- *  - **replSet** {Object, default: null} a hash off options to set on the 
replSet object, see **ReplSet** constructor**
- *  - **mongos** {Object, default: null} a hash off options to set on the 
mongos object, see **Mongos** constructor**
- *
- * @param {String} url connection url for MongoDB.
- * @param {Object} [options] optional options for insert command
- * @param {Function} callback this will be called after executing this method. 
The first parameter will contain the Error object if an error occured, or null 
otherwise. While the second parameter will contain the initialized db object or 
null if an error occured.
- * @return {null}
- * @api public
- */
-MongoClient.connect = function(url, options, callback) {
-  var args = Array.prototype.slice.call(arguments, 1);
-  callback = typeof args[args.length - 1] == 'function' ? args.pop() : null;
-  options = args.length ? args.shift() : null;
-  options = options || {};
-
-  // Set default empty server options  
-  var serverOptions = options.server || {};
-  var mongosOptions = options.mongos || {};
-  var replSetServersOptions = options.replSet || options.replSetServers || {};
-  var dbOptions = options.db || {};
-
-  // If callback is null throw an exception
-  if(callback == null) 
-    throw new Error("no callback function provided");
-
-  // Parse the string
-  var object = parse(url, options);
-  // Merge in any options for db in options object
-  if(dbOptions) {
-    for(var name in dbOptions) object.db_options[name] = dbOptions[name];
-  }
-
-  // Added the url to the options
-  object.db_options.url = url;
-
-  // Merge in any options for server in options object
-  if(serverOptions) {
-    for(var name in serverOptions) object.server_options[name] = 
serverOptions[name];
-  }
-
-  // Merge in any replicaset server options
-  if(replSetServersOptions) {
-    for(var name in replSetServersOptions) object.rs_options[name] = 
replSetServersOptions[name];    
-  }
-
-  // Merge in any replicaset server options
-  if(mongosOptions) {
-    for(var name in mongosOptions) object.mongos_options[name] = 
mongosOptions[name];    
-  }
-
-  // We need to ensure that the list of servers are only either direct members 
or mongos
-  // they cannot be a mix of monogs and mongod's
-  var totalNumberOfServers = object.servers.length;
-  var totalNumberOfMongosServers = 0;
-  var totalNumberOfMongodServers = 0;
-  var serverConfig = null;
-  var errorServers = {};
-
-  // Failure modes
-  if(object.servers.length == 0) throw new Error("connection string must 
contain at least one seed host");
-
-  // If we have no db setting for the native parser try to set the c++ one 
first
-  object.db_options.native_parser = _setNativeParser(object.db_options);
-  // If no auto_reconnect is set, set it to true as default for single servers
-  if(typeof object.server_options.auto_reconnect != 'boolean') {
-    object.server_options.auto_reconnect = true;
-  }
-
-  // If we have more than a server, it could be replicaset or mongos list
-  // need to verify that it's one or the other and fail if it's a mix
-  // Connect to all servers and run ismaster
-  for(var i = 0; i < object.servers.length; i++) {
-    // Set up socket options
-    var _server_options = {
-        poolSize:1
-      , socketOptions: {
-          connectTimeoutMS:30000 
-        , socketTimeoutMS: 30000
-      }
-      , auto_reconnect:false};
-
-    // Ensure we have ssl setup for the servers
-    if(object.rs_options.ssl) {
-      _server_options.ssl = object.rs_options.ssl;
-      _server_options.sslValidate = object.rs_options.sslValidate;
-      _server_options.sslCA = object.rs_options.sslCA;
-      _server_options.sslCert = object.rs_options.sslCert;
-      _server_options.sslKey = object.rs_options.sslKey;
-      _server_options.sslPass = object.rs_options.sslPass;
-    } else if(object.server_options.ssl) {
-      _server_options.ssl = object.server_options.ssl;
-      _server_options.sslValidate = object.server_options.sslValidate;
-      _server_options.sslCA = object.server_options.sslCA;
-      _server_options.sslCert = object.server_options.sslCert;
-      _server_options.sslKey = object.server_options.sslKey;
-      _server_options.sslPass = object.server_options.sslPass;
-    }
-
-    // Set up the Server object
-    var _server = object.servers[i].domain_socket 
-        ? new Server(object.servers[i].domain_socket, _server_options)
-        : new Server(object.servers[i].host, object.servers[i].port, 
_server_options);
-
-    var connectFunction = function(__server) { 
-      // Attempt connect
-      new Db(object.dbName, __server, {safe:false, 
native_parser:false}).open(function(err, db) {
-        // Update number of servers
-        totalNumberOfServers = totalNumberOfServers - 1;          
-        // If no error do the correct checks
-        if(!err) {
-          // Close the connection
-          db.close(true);
-          var isMasterDoc = db.serverConfig.isMasterDoc;
-          // Check what type of server we have
-          if(isMasterDoc.setName) totalNumberOfMongodServers++;
-          if(isMasterDoc.msg && isMasterDoc.msg == "isdbgrid") 
totalNumberOfMongosServers++;
-        } else {
-          errorServers[__server.host + ":" + __server.port] = __server;
-        }
-
-        if(totalNumberOfServers == 0) {
-          // If we have a mix of mongod and mongos, throw an error
-          if(totalNumberOfMongosServers > 0 && totalNumberOfMongodServers > 0) 
{
-            return process.nextTick(function() {
-              try {
-                callback(new Error("cannot combine a list of replicaset seeds 
and mongos seeds"));
-              } catch (err) {
-                if(db) db.close();
-                throw err
-              }              
-            })
-          }
-          
-          if(totalNumberOfMongodServers == 0 && object.servers.length == 1) {
-            var obj = object.servers[0];
-            serverConfig = obj.domain_socket ? 
-                new Server(obj.domain_socket, object.server_options)
-              : new Server(obj.host, obj.port, object.server_options);         
   
-          } else if(totalNumberOfMongodServers > 0 || 
totalNumberOfMongosServers > 0) {
-            var finalServers = object.servers
-              .filter(function(serverObj) {
-                return errorServers[serverObj.host + ":" + serverObj.port] == 
null;
-              })
-              .map(function(serverObj) {
-                  return new Server(serverObj.host, serverObj.port, 
object.server_options);
-              });
-            // Clean out any error servers
-            errorServers = {};
-            // Set up the final configuration
-            if(totalNumberOfMongodServers > 0) {
-              serverConfig = new ReplSet(finalServers, object.rs_options);     
           
-            } else {
-              serverConfig = new Mongos(finalServers, object.mongos_options);  
                       
-            }
-          }
-
-          if(serverConfig == null) {
-            return process.nextTick(function() {
-              try {
-                callback(new Error("Could not locate any valid servers in 
initial seed list"));
-              } catch (err) {
-                if(db) db.close();
-                throw err
-              }
-            });
-          }
-          // Ensure no firing off open event before we are ready
-          serverConfig.emitOpen = false;
-          // Set up all options etc and connect to the database
-          _finishConnecting(serverConfig, object, options, callback)
-        }
-      });        
-    }
-
-    // Wrap the context of the call
-    connectFunction(_server);    
-  }    
-}
-
-var _setNativeParser = function(db_options) {
-  if(typeof db_options.native_parser == 'boolean') return 
db_options.native_parser;
-
-  try {
-    require('bson').BSONNative.BSON;
-    return true;
-  } catch(err) {
-    return false;
-  }
-}
-
-var _finishConnecting = function(serverConfig, object, options, callback) {
-  // Safe settings
-  var safe = {};
-  // Build the safe parameter if needed
-  if(object.db_options.journal) safe.j = object.db_options.journal;
-  if(object.db_options.w) safe.w = object.db_options.w;
-  if(object.db_options.fsync) safe.fsync = object.db_options.fsync;
-  if(object.db_options.wtimeoutMS) safe.wtimeout = 
object.db_options.wtimeoutMS;
-
-  // If we have a read Preference set
-  if(object.db_options.read_preference) {
-    var readPreference = new ReadPreference(object.db_options.read_preference);
-    // If we have the tags set up
-    if(object.db_options.read_preference_tags)
-      readPreference = new ReadPreference(object.db_options.read_preference, 
object.db_options.read_preference_tags);
-    // Add the read preference
-    object.db_options.readPreference = readPreference;
-  }
-
-  // No safe mode if no keys
-  if(Object.keys(safe).length == 0) safe = false;
-
-  // Add the safe object
-  object.db_options.safe = safe;
-
-  // Get the socketTimeoutMS
-  var socketTimeoutMS = object.server_options.socketOptions.socketTimeoutMS || 
0;
-
-  // If we have a replset, override with replicaset socket timeout option if 
available
-  if(serverConfig instanceof ReplSet) {
-    socketTimeoutMS = object.rs_options.socketOptions.socketTimeoutMS || 
socketTimeoutMS;
-  }
-
-  // Set socketTimeout to the same as the connectTimeoutMS or 30 sec
-  serverConfig.connectTimeoutMS = serverConfig.connectTimeoutMS || 30000;
-  serverConfig.socketTimeoutMS = serverConfig.connectTimeoutMS;
-
-  // Set up the db options
-  var db = new Db(object.dbName, serverConfig, object.db_options);
-  // Open the db
-  db.open(function(err, db){
-    if(err) {
-      return process.nextTick(function() {
-        try {
-          callback(err, null);
-        } catch (err) {
-          if(db) db.close();
-          throw err
-        }
-      });
-    }
-
-    // Reset the socket timeout
-    serverConfig.socketTimeoutMS = socketTimeoutMS || 0;
-
-    // Set the provided write concern or fall back to w:1 as default
-    if(db.options !== null && !db.options.safe && !db.options.journal 
-      && !db.options.w && !db.options.fsync && typeof db.options.w != 'number'
-      && (db.options.safe == false && object.db_options.url.indexOf("safe=") 
== -1)) {
-        db.options.w = 1;
-    }
-
-    if(err == null && object.auth){
-      // What db to authenticate against
-      var authentication_db = db;
-      if(object.db_options && object.db_options.authSource) {
-        authentication_db = db.db(object.db_options.authSource);
-      }
-
-      // Build options object
-      var options = {};
-      if(object.db_options.authMechanism) options.authMechanism = 
object.db_options.authMechanism;
-      if(object.db_options.gssapiServiceName) options.gssapiServiceName = 
object.db_options.gssapiServiceName;
-
-      // Authenticate
-      authentication_db.authenticate(object.auth.user, object.auth.password, 
options, function(err, success){
-        if(success){
-          process.nextTick(function() {
-            try {
-              callback(null, db);            
-            } catch (err) {
-              if(db) db.close();
-              throw err
-            }
-          });
-        } else {
-          if(db) db.close();
-          process.nextTick(function() {
-            try {
-              callback(err ? err : new Error('Could not authenticate user ' + 
auth[0]), null);
-            } catch (err) {
-              if(db) db.close();
-              throw err
-            }
-          });
-        }
-      });
-    } else {
-      process.nextTick(function() {
-        try {
-          callback(err, db);            
-        } catch (err) {
-          if(db) db.close();
-          throw err
-        }
-      })
-    }
-  });
-}
-
-exports.MongoClient = MongoClient;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js
----------------------------------------------------------------------
diff --git 
a/web/demos/package/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js 
b/web/demos/package/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js
deleted file mode 100644
index 21e8cec..0000000
--- 
a/web/demos/package/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var Long = require('bson').Long
-  , timers = require('timers');
-
-// Set processor, setImmediate if 0.10 otherwise nextTick
-var processor = require('../utils').processor();
-
-/**
-  Reply message from mongo db
-**/
-var MongoReply = exports.MongoReply = function() {
-  this.documents = [];
-  this.index = 0;
-};
-
-MongoReply.prototype.parseHeader = function(binary_reply, bson) {
-  // Unpack the standard header first
-  this.messageLength = binary_reply[this.index] | binary_reply[this.index + 1] 
<< 8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  // Fetch the request id for this reply
-  this.requestId = binary_reply[this.index] | binary_reply[this.index + 1] << 
8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  // Fetch the id of the request that triggered the response
-  this.responseTo = binary_reply[this.index] | binary_reply[this.index + 1] << 
8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  // Skip op-code field
-  this.index = this.index + 4 + 4;
-  // Unpack the reply message
-  this.responseFlag = binary_reply[this.index] | binary_reply[this.index + 1] 
<< 8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  // Unpack the cursor id (a 64 bit long integer)
-  var low_bits = binary_reply[this.index] | binary_reply[this.index + 1] << 8 
| binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  var high_bits = binary_reply[this.index] | binary_reply[this.index + 1] << 8 
| binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  this.cursorId = new Long(low_bits, high_bits);
-  // Unpack the starting from
-  this.startingFrom = binary_reply[this.index] | binary_reply[this.index + 1] 
<< 8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 24;
-  this.index = this.index + 4;
-  // Unpack the number of objects returned
-  this.numberReturned = binary_reply[this.index] | binary_reply[this.index + 
1] << 8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] << 
24;
-  this.index = this.index + 4;
-}
-
-MongoReply.prototype.parseBody = function(binary_reply, bson, raw, callback) {
-  raw = raw == null ? false : raw;
-
-  try {
-    // Let's unpack all the bson documents, deserialize them and store them
-    for(var object_index = 0; object_index < this.numberReturned; 
object_index++) {
-      var _options = {promoteLongs: bson.promoteLongs};
-      
-      // Read the size of the bson object
-      var bsonObjectSize = binary_reply[this.index] | binary_reply[this.index 
+ 1] << 8 | binary_reply[this.index + 2] << 16 | binary_reply[this.index + 3] 
<< 24;
-      
-      // If we are storing the raw responses to pipe straight through
-      if(raw) {
-        // Deserialize the object and add to the documents array
-        this.documents.push(binary_reply.slice(this.index, this.index + 
bsonObjectSize));
-      } else {
-        // Deserialize the object and add to the documents array
-        this.documents.push(bson.deserialize(binary_reply.slice(this.index, 
this.index + bsonObjectSize), _options));
-      }
-      
-      // Adjust binary index to point to next block of binary bson data
-      this.index = this.index + bsonObjectSize;
-    }
-    
-    // No error return
-    callback(null);
-  } catch(err) {
-    return callback(err);
-  }
-}
-
-MongoReply.prototype.is_error = function(){
-  if(this.documents.length == 1) {
-    return this.documents[0].ok == 1 ? false : true;
-  }
-  return false;
-};
-
-MongoReply.prototype.error_message = function() {
-  return this.documents.length == 1 && this.documents[0].ok == 1 ? '' : 
this.documents[0].errmsg;
-};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/lib/mongodb/scope.js
----------------------------------------------------------------------
diff --git a/web/demos/package/node_modules/mongodb/lib/mongodb/scope.js 
b/web/demos/package/node_modules/mongodb/lib/mongodb/scope.js
deleted file mode 100644
index aaf3221..0000000
--- a/web/demos/package/node_modules/mongodb/lib/mongodb/scope.js
+++ /dev/null
@@ -1,199 +0,0 @@
-var Cursor2 = require('./cursor').Cursor
-  , Readable = require('stream').Readable
-  , utils = require('./utils')
-  , inherits = require('util').inherits;
-
-var Cursor = function Cursor(_scope_options, _cursor) {
-  //
-  // Backward compatible methods
-  this.toArray = function(callback) {
-    return _cursor.toArray(callback);
-  }
-
-  this.each = function(callback) {
-    return _cursor.each(callback);
-  }
-
-  this.next = function(callback) {
-    this.nextObject(callback);
-  }
-
-  this.nextObject = function(callback) {
-    return _cursor.nextObject(callback);
-  }
-
-  this.setReadPreference = function(readPreference, callback) {
-    _scope_options.readPreference = {readPreference: readPreference};
-    _cursor.setReadPreference(readPreference, callback);
-    return this;
-  }
-
-  this.batchSize = function(batchSize, callback) {
-    _scope_options.batchSize = batchSize;
-    _cursor.batchSize(_scope_options.batchSize, callback);
-    return this;
-  }
-
-  this.count = function(applySkipLimit, callback) {
-    return _cursor.count(applySkipLimit, callback);
-  }
-
-  this.stream = function(options) {
-    return _cursor.stream(options);
-  }
-
-  this.close = function(callback) {
-    return _cursor.close(callback);
-  }
-
-  this.explain = function(callback) {
-    return _cursor.explain(callback);
-  }
-
-  this.isClosed = function(callback) {
-    return _cursor.isClosed();
-  }
-
-  this.rewind = function() {
-    return _cursor.rewind();
-  }
-
-  // Internal methods
-  this.limit = function(limit, callback) {
-    _cursor.limit(limit, callback);
-    _scope_options.limit = limit;
-    return this;
-  }
-
-  this.skip = function(skip, callback) {
-    _cursor.skip(skip, callback);
-    _scope_options.skip = skip;
-    return this;
-  }
-
-  this.hint = function(hint) {
-    _scope_options.hint = hint;
-    _cursor.hint = _scope_options.hint;
-    return this;
-  }
-
-  this.maxTimeMS = function(maxTimeMS) {  
-    _cursor.maxTimeMS(maxTimeMS)
-    _scope_options.maxTimeMS = maxTimeMS;
-    return this;
-  },  
-
-  this.sort = function(keyOrList, direction, callback) {
-    _cursor.sort(keyOrList, direction, callback);
-    _scope_options.sort = keyOrList;
-    return this;
-  },
-
-  this.fields = function(fields) {
-    _fields = fields;
-    _cursor.fields = _fields;
-    return this;
-  }
-
-  //
-  // Backward compatible settings
-  Object.defineProperty(this, "timeout", {
-    get: function() {
-      return _cursor.timeout;
-    }
-  });
-
-  Object.defineProperty(this, "read", {
-    get: function() {
-      return _cursor.read;
-    }
-  });
-
-  Object.defineProperty(this, "items", {
-    get: function() {
-      return _cursor.items;
-    }
-  });  
-}
-
-var Scope = function(collection, _selector, _fields, _scope_options) {
-  var self = this;
-
-  // Ensure we have at least an empty cursor options object
-  _scope_options = _scope_options || {};
-  var _write_concern = _scope_options.write_concern || null;
-
-  // Ensure default read preference
-  if(!_scope_options.readPreference) _scope_options.readPreference = 
{readPreference: 'primary'};
-
-  // Set up the cursor
-  var _cursor = new Cursor2(
-        collection.db, collection, _selector
-      , _fields, _scope_options
-    );
-
-  // Write branch options
-  var writeOptions = {
-    insert: function(documents, callback) {
-      // Merge together options
-      var options = _write_concern || {};
-      // Execute insert
-      collection.insert(documents, options, callback);
-    },
-    
-    save: function(document, callback) {
-      // Merge together options
-      var save_options = _write_concern || {};
-      // Execute save
-      collection.save(document, save_options, function(err, result) {
-        if(typeof result == 'number' && result == 1) {
-          return callback(null, document);
-        }
-
-        return callback(null, document);
-      });
-    },
-
-    find: function(selector) {
-      _selector = selector;
-      return writeOptions;
-    },
-
-    //
-    // Update is implicit multiple document update
-    update: function(operations, callback) {
-      // Merge together options
-      var update_options = _write_concern || {};
-      
-      // Set up options, multi is default operation
-      update_options.multi = _scope_options.multi ? _scope_options.multi : 
true;
-      if(_scope_options.upsert) update_options.upsert = _scope_options.upsert;
-      
-      // Execute options
-      collection.update(_selector, operations, update_options, function(err, 
result, obj) {
-        callback(err, obj);
-      });
-    },
-  }
-
-  // Set write concern
-  this.withWriteConcern = function(write_concern) {
-    // Save the current write concern to the Scope
-    _scope_options.write_concern = write_concern;
-    _write_concern = write_concern;
-    // Only allow legal options
-    return writeOptions;
-  }
-
-  // Start find
-  this.find = function(selector, options) {
-    // Save the current selector
-    _selector = selector;
-    // Set the cursor
-    _cursor.selector = selector;
-    // Return only legal read options
-    return new Cursor(_scope_options, _cursor);
-  }
-}
-
-exports.Scope = Scope;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/lib/mongodb/utils.js
----------------------------------------------------------------------
diff --git a/web/demos/package/node_modules/mongodb/lib/mongodb/utils.js 
b/web/demos/package/node_modules/mongodb/lib/mongodb/utils.js
deleted file mode 100644
index 4eca8c0..0000000
--- a/web/demos/package/node_modules/mongodb/lib/mongodb/utils.js
+++ /dev/null
@@ -1,202 +0,0 @@
-var timers = require('timers');
-
-/**
- * Sort functions, Normalize and prepare sort parameters
- */
-var formatSortValue = exports.formatSortValue = function(sortDirection) {
-  var value = ("" + sortDirection).toLowerCase();
-
-  switch (value) {
-    case 'ascending':
-    case 'asc':
-    case '1':
-      return 1;
-    case 'descending':
-    case 'desc':
-    case '-1':
-      return -1;
-    default:
-      throw new Error("Illegal sort clause, must be of the form "
-                    + "[['field1', '(ascending|descending)'], "
-                    + "['field2', '(ascending|descending)']]");
-  }
-};
-
-var formattedOrderClause = exports.formattedOrderClause = function(sortValue) {
-  var orderBy = {};
-
-  if (Array.isArray(sortValue)) {
-    for(var i = 0; i < sortValue.length; i++) {
-      if(sortValue[i].constructor == String) {
-        orderBy[sortValue[i]] = 1;
-      } else {
-        orderBy[sortValue[i][0]] = formatSortValue(sortValue[i][1]);
-      }      
-    }
-  } else if(Object.prototype.toString.call(sortValue) === '[object Object]') {
-    orderBy = sortValue;
-  } else if (sortValue.constructor == String) {
-    orderBy[sortValue] = 1;
-  } else {
-    throw new Error("Illegal sort clause, must be of the form " +
-      "[['field1', '(ascending|descending)'], ['field2', 
'(ascending|descending)']]");
-  }
-
-  return orderBy;
-};
-
-exports.encodeInt = function(value) {
-  var buffer = new Buffer(4);
-  buffer[3] = (value >> 24) & 0xff;      
-  buffer[2] = (value >> 16) & 0xff;
-  buffer[1] = (value >> 8) & 0xff;
-  buffer[0] = value & 0xff;
-  return buffer;
-}
-
-exports.encodeIntInPlace = function(value, buffer, index) {
-  buffer[index + 3] = (value >> 24) & 0xff;                    
-       buffer[index + 2] = (value >> 16) & 0xff;
-       buffer[index + 1] = (value >> 8) & 0xff;
-       buffer[index] = value & 0xff;
-}
-
-exports.encodeCString = function(string) {
-  var buf = new Buffer(string, 'utf8');
-  return [buf, new Buffer([0])];
-}
-
-exports.decodeUInt32 = function(array, index) {
-  return array[index] | array[index + 1] << 8 | array[index + 2] << 16 | 
array[index + 3] << 24;
-}
-
-// Decode the int
-exports.decodeUInt8 = function(array, index) {
-  return array[index];
-}
-
-/**
- * Context insensitive type checks
- */
-
-var toString = Object.prototype.toString;
-
-exports.isObject = function (arg) {
-  return '[object Object]' == toString.call(arg)
-}
-
-exports.isArray = function (arg) {
-  return Array.isArray(arg) ||
-    'object' == typeof arg && '[object Array]' == toString.call(arg)
-}
-
-exports.isDate = function (arg) {
-  return 'object' == typeof arg && '[object Date]' == toString.call(arg)
-}
-
-exports.isRegExp = function (arg) {
-  return 'object' == typeof arg && '[object RegExp]' == toString.call(arg)
-}
-
-/**
- * Wrap a Mongo error document in an Error instance
- * @ignore
- * @api private
- */
-var toError = function(error) {
-  if (error instanceof Error) return error;
-
-  var msg = error.err || error.errmsg || error.errMessage || error;
-  var e = new Error(msg);
-  e.name = 'MongoError';
-
-  // Get all object keys
-  var keys = typeof error == 'object'
-    ? Object.keys(error)
-    : [];
-
-  for(var i = 0; i < keys.length; i++) {
-    e[keys[i]] = error[keys[i]];
-  }
-
-  return e;
-}
-exports.toError = toError;
-
-/**
- * Convert a single level object to an array
- * @ignore
- * @api private
- */
-exports.objectToArray = function(object) {
-  var list = [];
-
-  for(var name in object) {
-    list.push(object[name])
-  }
-
-  return list;
-}
-
-/**
- * Handle single command document return
- * @ignore
- * @api private
- */
-exports.handleSingleCommandResultReturn = function(override_value_true, 
override_value_false, callback) {
-  return function(err, result, connection) {
-    if(err && typeof callback == 'function') return callback(err, null);
-    if(!result || !result.documents || result.documents.length == 0)
-      if(typeof callback == 'function') return callback(toError("command 
failed to return results"), null)
-    if(result && result.documents[0].ok == 1) {
-      if(override_value_true) return callback(null, override_value_true)
-      if(typeof callback == 'function') return callback(null, 
result.documents[0]);
-    }
-
-    // Return the error from the document
-    if(typeof callback == 'function') return 
callback(toError(result.documents[0]), override_value_false);    
-  }
-}
-
-/**
- * Return correct processor
- * @ignore
- * @api private
- */
-exports.processor = function() {
-  // Set processor, setImmediate if 0.10 otherwise nextTick
-  process.maxTickDepth = Infinity;
-  // Only use nextTick
-  return process.nextTick;
-}
-
-/**
- * Allow setting the socketTimeoutMS on all connections
- * to work around issues such as secondaries blocking due to compaction
- *
- * @ignore
- * @api private
- */
-exports.setSocketTimeoutProperty = function(self, options) {
-  Object.defineProperty(self, "socketTimeoutMS", {
-      enumerable: true
-    , get: function () { return options.socketTimeoutMS; }
-    , set: function (value) { 
-      // Set the socket timeoutMS value
-      options.socketTimeoutMS = value;
-
-      // Get all the connections
-      var connections = self.allRawConnections();
-      for(var i = 0; i < connections.length; i++) {
-        connections[i].socketTimeoutMS = value;
-      }
-    }
-  });  
-}
-
-exports.hasWriteCommands = function(connection) {
-  return connection != null && connection.serverCapabilities != null && 
connection.serverCapabilities.hasWriteCommands;
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/node_modules/bson/.travis.yml
----------------------------------------------------------------------
diff --git 
a/web/demos/package/node_modules/mongodb/node_modules/bson/.travis.yml 
b/web/demos/package/node_modules/mongodb/node_modules/bson/.travis.yml
deleted file mode 100644
index 5445961..0000000
--- a/web/demos/package/node_modules/mongodb/node_modules/bson/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
-  - 0.8
-  - 0.10 # development version of 0.8, may be unstable
-  - 0.11
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/node_modules/bson/Makefile
----------------------------------------------------------------------
diff --git a/web/demos/package/node_modules/mongodb/node_modules/bson/Makefile 
b/web/demos/package/node_modules/mongodb/node_modules/bson/Makefile
deleted file mode 100644
index 77ce4e0..0000000
--- a/web/demos/package/node_modules/mongodb/node_modules/bson/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-NODE = node
-NPM = npm
-NODEUNIT = node_modules/nodeunit/bin/nodeunit
-
-all:   clean node_gyp
-
-test: clean node_gyp
-       npm test
-
-node_gyp: clean
-       node-gyp configure build
-
-clean:
-       node-gyp clean
-
-browserify:
-       node_modules/.bin/onejs build browser_build/package.json 
browser_build/bson.js
-
-.PHONY: all

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/node_modules/bson/README.md
----------------------------------------------------------------------
diff --git a/web/demos/package/node_modules/mongodb/node_modules/bson/README.md 
b/web/demos/package/node_modules/mongodb/node_modules/bson/README.md
deleted file mode 100644
index 1a6fc2b..0000000
--- a/web/demos/package/node_modules/mongodb/node_modules/bson/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-Javascript + C++ BSON parser
-============================
-
-This BSON parser is primarily meant for usage with the `mongodb` node.js 
driver. However thanks to such wonderful tools at `onejs` we are able to 
package up a BSON parser that will work in the browser aswell. The current 
build is located in the `browser_build/bson.js` file.
-
-A simple example on how to use it
-
-    <head>
-      <script 
src="https://raw.github.com/mongodb/js-bson/master/browser_build/bson.js";>
-      </script>
-    </head>
-    <body onload="start();">
-    <script>
-      function start() {
-        var BSON = bson().BSON;
-        var Long = bson().Long;
-
-        var doc = {long: Long.fromNumber(100)}
-
-        // Serialize a document
-        var data = BSON.serialize(doc, false, true, false);
-        // De serialize it again
-        var doc_2 = BSON.deserialize(data);
-      }
-    </script>
-    </body>
-
-  It's got two simple methods to use in your application.
-
-  * BSON.serialize(object, checkKeys, asBuffer, serializeFunctions)
-     * @param {Object} object the Javascript object to serialize.
-     * @param {Boolean} checkKeys the serializer will check if keys are valid.
-     * @param {Boolean} asBuffer return the serialized object as a Buffer 
object **(ignore)**.
-     * @param {Boolean} serializeFunctions serialize the javascript functions 
**(default:false)**
-     * @return {TypedArray/Array} returns a TypedArray or Array depending on 
what your browser supports
- 
-  * BSON.deserialize(buffer, options, isArray)
-     * Options
-       * **evalFunctions** {Boolean, default:false}, evaluate functions in the 
BSON document scoped to the object deserialized.
-       * **cacheFunctions** {Boolean, default:false}, cache evaluated 
functions for reuse.
-       * **cacheFunctionsCrc32** {Boolean, default:false}, use a crc32 code 
for caching, otherwise use the string of the function.
-     * @param {TypedArray/Array} a TypedArray/Array containing the BSON data
-     * @param {Object} [options] additional options used for the 
deserialization.
-     * @param {Boolean} [isArray] ignore used for recursive parsing.
-     * @return {Object} returns the deserialized Javascript Object.

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/e1a45507/web/demos/package/node_modules/mongodb/node_modules/bson/binding.gyp
----------------------------------------------------------------------
diff --git 
a/web/demos/package/node_modules/mongodb/node_modules/bson/binding.gyp 
b/web/demos/package/node_modules/mongodb/node_modules/bson/binding.gyp
deleted file mode 100644
index f308f3e..0000000
--- a/web/demos/package/node_modules/mongodb/node_modules/bson/binding.gyp
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  'targets': [
-    {
-      'target_name': 'bson',
-      'sources': [ 'ext/bson.cc' ],
-      'cflags!': [ '-fno-exceptions' ],
-      'cflags_cc!': [ '-fno-exceptions' ],
-      'conditions': [
-        ['OS=="mac"', {
-          'xcode_settings': {
-            'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
-          }
-        }]
-      ]
-    }
-  ]
-}


Reply via email to