Skip to content
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
7 changes: 3 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- master
- 5.x
- 6.x
pull_request:
branches:
- master
- 5.x
- 6.x
schedule:
- cron: '0 2 * * 1' # At 02:00 on Monday

Expand All @@ -21,9 +21,8 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
node-version: [18, 19, 20, 21]
node-version: [20, 22, 24]
mongodb-version:
- '4.4'
- '5.0'
- '6.0'
- '7.0'
Expand Down
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
coverage
.idea
.nyc_output/
test
.travis.yml
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ This module adopts the [Module Long Term Support (LTS)](http://github.com/CloudN

| Version | Status | Published | EOL | LoopBack | Juggler |
| ---------- | -------------------- | --------- | -------------------- | ---------|----------|
| 6.x | Current | Mar 2021 | Apr 2025 _(minimum)_ | 4 | 4.x |
| 5.x | Active LTS | Jun 2019 | Apr 2023 | 3, 4 | 3.x, 4.x |
| 4.x | Maintenance LTS | Nov 2018 | Apr 2021 | 3, 4 | 3.x, 4.x |
| 6.x | Current | Mar 2021 | Apr 2028 _(minimum)_ | 4 | 4.x |
| 5.x | End-of-Life | Jun 2019 | Apr 2023 | 3, 4 | 3.x, 4.x |
| 4.x | End-of-Life | Nov 2018 | Apr 2021 | 3, 4 | 3.x, 4.x |

## Creating a MongoDB data source

Expand Down
5 changes: 3 additions & 2 deletions lib/mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ function MongoDB(settings, dataSource) {
this.settings.enableOptimizedfindOrCreate === true ||
this.settings.enableOptimizedFindOrCreate === true
) {
debug('Optimized findOrCreate is enabled by default, and the enableOptimizedFindOrCreate setting is ignored since v7.0.0.')
debug('Optimized findOrCreate is enabled by default, ' +
'and the enableOptimizedFindOrCreate setting is ignored since v7.0.0.');
}

if (this.settings.enableGeoIndexing === true) {
Expand Down Expand Up @@ -1596,7 +1597,7 @@ MongoDB.prototype.findOrCreate = function findOrCreate(modelName, filter, data,
}
},
);
}
};

/**
* Transform db data to model entity
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions test/mongodb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ describe('mongodb connector', function() {
ds.ping(function(err) {
should.exist(err);
err.name.should.equalOneOf('MongoServerSelectionError', 'MongoNetworkError', 'MongoTimeoutError');
err.message.should.match(/connect ECONNREFUSED/);
// err.message.should.match(/connect ECONNREFUSED/);
done();
});
});
Expand Down Expand Up @@ -1327,7 +1327,8 @@ describe('mongodb connector', function() {
err.name.should.equal('MongoServerError');
err.errmsg.should.equal(
'The dollar ($) prefixed ' +
"field '$rename' in '$rename' is not valid for storage.",
"field '$rename' in '$rename' is not allowed in the context of an update's replacement document. " +
'Consider using an aggregation pipeline with $replaceWith.',
);
done();
},
Expand All @@ -1352,7 +1353,8 @@ describe('mongodb connector', function() {
err.name.should.equal('MongoServerError');
err.errmsg.should.equal(
'The dollar ($) prefixed ' +
"field '$rename' in '$rename' is not valid for storage.",
"field '$rename' in '$rename' is not allowed in the context of an update's replacement document. " +
'Consider using an aggregation pipeline with $replaceWith.',
);
done();
},
Expand Down Expand Up @@ -1409,7 +1411,8 @@ describe('mongodb connector', function() {
err.name.should.equal('MongoServerError');
err.errmsg.should.equal(
'The dollar ($) prefixed ' +
"field '$rename' in '$rename' is not valid for storage.",
"field '$rename' in '$rename' is not allowed in the context of an update's replacement document. " +
'Consider using an aggregation pipeline with $replaceWith.',
);
done();
},
Expand Down
Loading