aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mongodb/lib/server.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-08-14 10:13:55 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-08-14 10:13:55 +0000
commita532390f81e35f611fd02ad3d543f4d52217ca3c (patch)
tree7bebb4f5614afb82c3103b6e9730a62f0b97a42d /node_modules/mongodb/lib/server.js
parentef2674cfe13d2c425c5a3b312244c46f2531979d (diff)
Fixed signin and signup
Diffstat (limited to 'node_modules/mongodb/lib/server.js')
-rw-r--r--node_modules/mongodb/lib/server.js37
1 files changed, 35 insertions, 2 deletions
diff --git a/node_modules/mongodb/lib/server.js b/node_modules/mongodb/lib/server.js
index cf5ba5a..78684bb 100644
--- a/node_modules/mongodb/lib/server.js
+++ b/node_modules/mongodb/lib/server.js
@@ -15,7 +15,16 @@ var EventEmitter = require('events').EventEmitter
, MAX_JS_INT = require('./utils').MAX_JS_INT
, translateOptions = require('./utils').translateOptions
, filterOptions = require('./utils').filterOptions
- , mergeOptions = require('./utils').mergeOptions;
+ , mergeOptions = require('./utils').mergeOptions
+ , os = require('os');
+
+// Get package.json variable
+var driverVersion = require(__dirname + '/../package.json').version;
+var nodejsversion = f('Node.js %s, %s', process.version, os.endianness());
+var type = os.type();
+var name = process.platform;
+var architecture = process.arch;
+var release = os.release();
/**
* @fileOverview The **Server** class is a class that represents a single server topology and is
@@ -40,7 +49,8 @@ var EventEmitter = require('events').EventEmitter
, 'sslCA', 'sslCert', 'sslKey', 'sslPass', 'socketOptions', 'bufferMaxEntries'
, 'store', 'auto_reconnect', 'autoReconnect', 'emitError'
, 'keepAlive', 'noDelay', 'connectTimeoutMS', 'socketTimeoutMS'
- , 'loggerLevel', 'logger', 'reconnectTries', 'reconnectInterval', 'monitoring'];
+ , 'loggerLevel', 'logger', 'reconnectTries', 'reconnectInterval', 'monitoring'
+ , 'appname', 'domainsEnabled'];
/**
* Creates a new Server instance
@@ -67,6 +77,7 @@ var EventEmitter = require('events').EventEmitter
* @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
* @param {number} [options.monitoring=true] Triggers the server instance to call ismaster
* @param {number} [options.haInterval=10000] The interval of calling ismaster when monitoring is enabled.
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @fires Server#connect
* @fires Server#close
* @fires Server#error
@@ -130,6 +141,28 @@ var Server = function(host, port, options) {
clonedOptions.keepAlive = clonedOptions.keepAlive > 0;
}
+ // Build default client information
+ this.clientInfo = {
+ driver: {
+ name: "nodejs",
+ version: driverVersion
+ },
+ os: {
+ type: type,
+ name: name,
+ architecture: architecture,
+ version: release
+ },
+ platform: nodejsversion
+ }
+
+ // Build default client information
+ clonedOptions.clientInfo = this.clientInfo;
+ // Do we have an application specific string
+ if(options.appname) {
+ clonedOptions.clientInfo.application = { name: options.appname };
+ }
+
// Create an instance of a server instance from mongodb-core
var server = new CServer(clonedOptions);
// Server capabilities