Skip to content

Commit

Permalink
chore(connection): set driverInfo option
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 4, 2019
1 parent cee9152 commit 1eaefc8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/connection.js
Expand Up @@ -13,6 +13,7 @@ const PromiseProvider = require('./promise_provider');
const applyPlugins = require('./helpers/schema/applyPlugins');
const get = require('./helpers/get');
const mongodb = require('mongodb');
const pkg = require('../package.json');
const utils = require('./utils');

const parseConnectionString = require('mongodb/lib/core').parseConnectionString;
Expand Down Expand Up @@ -620,6 +621,12 @@ Connection.prototype.openUri = function(uri, options, callback) {
options.useUnifiedTopology = false;
}
}
if (!utils.hasUserDefinedProperty(options, 'driverInfo')) {
options.driverInfo = {
name: 'Mongoose',
version: pkg.version
};
}

const parsePromise = new Promise((resolve, reject) => {
parseConnectionString(uri, options, (err, parsed) => {
Expand Down

0 comments on commit 1eaefc8

Please sign in to comment.