monastery 1.42.0 → 1.42.1

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 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
+ ### [1.42.1](https://github.com/boycce/monastery/compare/1.42.0...1.42.1) (2023-10-09)
6
+
5
7
  ## [1.42.0](https://github.com/boycce/monastery/compare/1.41.2...1.42.0) (2023-10-09)
6
8
 
7
9
  ### [1.41.2](https://github.com/boycce/monastery/compare/1.41.1...1.41.2) (2023-10-04)
package/lib/model.js CHANGED
@@ -39,14 +39,16 @@ let Model = module.exports = function(name, opts, manager) {
39
39
  error: manager.error,
40
40
  info: manager.info,
41
41
  warn: manager.warn,
42
- insertBL: opts.insertBL || ['_id'],
42
+ insertBL: opts.insertBL
43
+ ? !opts.insertBL.includes('_id') && !opts.insertBL.includes('-_id') ? ['_id'].concat(opts.insertBL) : opts.insertBL
44
+ : ['_id'],
43
45
  fields: { ...(util.deepCopy(opts.fields) || {}) },
44
46
  findBL: opts.findBL || ['password'],
45
47
  manager: manager,
46
48
  messages: opts.messages || {},
47
49
  name: name,
48
50
  rules: { ...(opts.rules || {}) },
49
- updateBL: opts.updateBL || ['_id'],
51
+ updateBL: opts.updateBL || [],
50
52
  })
51
53
 
52
54
  // Run before model hooks
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "monastery",
3
3
  "description": "⛪ A straight forward MongoDB ODM built around Monk",
4
4
  "author": "Ricky Boyce",
5
- "version": "1.42.0",
5
+ "version": "1.42.1",
6
6
  "license": "MIT",
7
7
  "repository": "github:boycce/monastery",
8
8
  "homepage": "https://boycce.github.io/monastery/",
@@ -365,7 +365,7 @@ module.exports = function(monastery, opendb) {
365
365
  }
366
366
  },
367
367
  insertBL: [
368
- '_id', // default
368
+ // '_id', // default
369
369
  'dog',
370
370
  'animals.cat',
371
371
  'pets.age',
@@ -374,7 +374,7 @@ module.exports = function(monastery, opendb) {
374
374
  'deep.deep2.deep3'
375
375
  ],
376
376
  updateBL: [
377
- '_id' // default
377
+ // '_id' // default
378
378
  ],
379
379
  })
380
380
  let doc1Id = db.id()