Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mongodb to 6.5.0 #290

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The MongoDB transport takes the following options. Only option `db` is required:
| ------ | :----------------------------------------------- |
| db | **REQUIRED**. MongoDB connection uri, pre-connected `MongoClient` object or promise which resolves to a pre-connected `MongoClient` object. |
| dbname | The database name to connect to, defaults to DB name based on connection URI if not provided, ignored if using a pre-connected connection. |
| options| MongoDB connection parameters.<br/>Defaults to `{poolSize: 2, autoReconnect: true, useNewUrlParser: true}`). |
| options| MongoDB connection parameters.<br/>Defaults to `{maxPoolSize: 2}`). |
| collection | The name of the collection you want to store log messages in.<br/>Defaults to `log`. |
| level | Level of messages that this transport should log.<br/>Defaults to `info`. |
| silent | Boolean flag indicating whether to suppress output.<br/>Defaults to `false`. |
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author [email protected] (Yurij Mikhalevich)
*/
'use strict';
const ObjectID = require('mongodb').ObjectID;
const ObjectId = require('mongodb').ObjectId;


/**
Expand All @@ -26,9 +26,9 @@
* @param {Array} optParents Object's parents
* @returns {Object} Adjusted clone of object
*/
function cloneMeta(node, optParents) {

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Function 'cloneMeta' has too many statements (22). Maximum allowed is 15

Check warning on line 29 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Function 'cloneMeta' has a complexity of 18. Maximum allowed is 11
if (!((node !== null && typeof node === 'object') || typeof node === 'function')
|| (node instanceof ObjectID) || (node instanceof Buffer)) {
|| (node instanceof ObjectId) || (node instanceof Buffer)) {
return node;
}
let copy = Array.isArray(node) ? [] : {};
Expand All @@ -42,7 +42,7 @@
optParents.push(node);
for (const key in node) {
if (!Object.prototype.hasOwnProperty.call(node, key)) {
continue;

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Unexpected use of continue statement

Check warning on line 45 in lib/helpers.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Unexpected use of continue statement
}
const value = node[key];
let newKey = key;
Expand Down
4 changes: 1 addition & 3 deletions lib/winston-mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* @param {number} options.expireAfterSeconds Seconds before the entry is removed.
* Do not use if capped is set.
*/
const MongoDB = exports.MongoDB = function (options) {

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Function has a complexity of 15. Maximum allowed is 11

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Function has too many statements (37). Maximum allowed is 15

Check warning on line 57 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Function has a complexity of 15. Maximum allowed is 11
Transport.call(this, options);
options = (options || {});
if (!options.db) {
Expand All @@ -66,9 +66,7 @@
this.options = options.options;
if (!this.options) {
this.options = {
poolSize: 2,
autoReconnect: true,
useNewUrlParser: true
maxPoolSize: 2
};
}
this.collection = (options.collection || 'log');
Expand All @@ -90,7 +88,7 @@
const self = this;

function setupDatabaseAndEmptyQueue(db) {
return createCollection(db).then(db => {

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

'db' is already declared in the upper scope on line 90 column 39

Check warning on line 91 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

'db' is already declared in the upper scope on line 90 column 39
self.logDb = db;
processOpQueue();
}, err => {
Expand Down Expand Up @@ -289,7 +287,7 @@
* @param {Stream} stream Pass in a pre-existing stream.
* @returns {Stream} Log stream for the transport
*/
MongoDB.prototype.stream = function (options, stream) {

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v6.0-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v5.0-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v4.4-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v6.0-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v5.0-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v4.4-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (20, v4.4-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (18, v5.0-latest)

Function has too many statements (17). Maximum allowed is 15

Check warning on line 290 in lib/winston-mongodb.js

View workflow job for this annotation

GitHub Actions / unit-tests (16, v6.0-latest)

Function has too many statements (17). Maximum allowed is 15
options = options || {};
stream = stream || new Stream();
let start = options.start;
Expand Down
Loading