monastery 3.5.10 → 3.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +2 -0
- package/lib/manager.js +3 -2
- package/package.json +1 -1
- package/test/manager.js +3 -3
package/changelog.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.5.11](https://github.com/boycce/monastery/compare/3.5.10...3.5.11) (2026-02-02)
|
|
6
|
+
|
|
5
7
|
### [3.5.10](https://github.com/boycce/monastery/compare/3.5.9...3.5.10) (2026-02-02)
|
|
6
8
|
|
|
7
9
|
### [3.5.9](https://github.com/boycce/monastery/compare/3.5.8...3.5.9) (2025-12-23)
|
package/lib/manager.js
CHANGED
|
@@ -40,7 +40,7 @@ function Manager(uri, opts, parent) {
|
|
|
40
40
|
const mongoOpts = Object.keys(opts || {}).reduce((acc, key) => {
|
|
41
41
|
if (![
|
|
42
42
|
'databaseName', 'defaultObjects', 'logLevel', 'imagePlugin', 'limit', 'noDefaults', 'nullObjects',
|
|
43
|
-
'promise', 'timestamps', 'useMilliseconds', 'forJest',
|
|
43
|
+
'promise', 'timestamps', 'useMilliseconds', 'forJest', 'showConnectionInfo',
|
|
44
44
|
].includes(key)) {
|
|
45
45
|
acc[key] = opts[key]
|
|
46
46
|
}
|
|
@@ -58,6 +58,7 @@ function Manager(uri, opts, parent) {
|
|
|
58
58
|
that._openQueue = []
|
|
59
59
|
that.emitter = new EventEmitter()
|
|
60
60
|
that.forJest = opts.forJest || false
|
|
61
|
+
that.showConnectionInfo = opts.showConnectionInfo || false
|
|
61
62
|
|
|
62
63
|
// If there is no DEBUG= environment variable, we will need to force the debugs on (due to bug on debug@4.3.4)
|
|
63
64
|
if (!debug.namespaces) {
|
|
@@ -288,7 +289,7 @@ Manager.prototype.open = async function() {
|
|
|
288
289
|
this._state = 'opening'
|
|
289
290
|
this.db = this.client.db()
|
|
290
291
|
await this.client.connect() // now optional since db().command() will auto-connect
|
|
291
|
-
if (
|
|
292
|
+
if (this.showConnectionInfo) console.info(`Connected to MongoDB in ${Date.now() - this.openTimestamp}ms`)
|
|
292
293
|
this.emitter.emit(this._state = 'open', this)
|
|
293
294
|
return this
|
|
294
295
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "monastery",
|
|
3
3
|
"description": "⛪ A simple, straightforward MongoDB ODM",
|
|
4
4
|
"author": "Ricky Boyce",
|
|
5
|
-
"version": "3.5.
|
|
5
|
+
"version": "3.5.11",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:boycce/monastery",
|
|
8
8
|
"homepage": "https://boycce.github.io/monastery/",
|
package/test/manager.js
CHANGED
|
@@ -121,9 +121,9 @@ test('Manager > get collection', async () => {
|
|
|
121
121
|
})
|
|
122
122
|
|
|
123
123
|
test('Manager > multiple managers', async () => {
|
|
124
|
-
const db1 = monastery.manager('localhost/monastery', { logLevel: 5
|
|
125
|
-
const db2 = monastery.manager('localhost/monastery', { logLevel: 6
|
|
126
|
-
const db3 = monastery.manager('localhost/monastery', { logLevel: 7
|
|
124
|
+
const db1 = monastery.manager('localhost/monastery', { logLevel: 5 })
|
|
125
|
+
const db2 = monastery.manager('localhost/monastery', { logLevel: 6 })
|
|
126
|
+
const db3 = monastery.manager('localhost/monastery', { logLevel: 7 })
|
|
127
127
|
|
|
128
128
|
expect(monastery.opts.logLevel).not.toEqual(6) // default manager
|
|
129
129
|
expect(db2.opts.logLevel).not.toEqual(db1.opts.logLevel)
|