monastery 3.0.8 → 3.0.10

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,10 @@
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.0.10](https://github.com/boycce/monastery/compare/3.0.8...3.0.10) (2024-04-30)
6
+
7
+ ### [3.0.9](https://github.com/boycce/monastery/compare/3.0.8...3.0.9) (2024-04-30)
8
+
5
9
  ### [3.0.8](https://github.com/boycce/monastery/compare/3.0.7...3.0.8) (2024-04-30)
6
10
 
7
11
  ### [3.0.7](https://github.com/boycce/monastery/compare/3.0.5...3.0.7) (2024-04-29)
package/docs/readme.md CHANGED
@@ -89,11 +89,17 @@ You can view MongoDB's [compatibility table here](https://www.mongodb.com/docs/d
89
89
  - model.remove() now returns `{ acknowledged: true, deletedCount: 1 }`, instead of `{ results: {n:1, ok:1} }`
90
90
  - model._indexes() now returns collection._indexes() not collection._indexInformation()
91
91
  - db.model.* moved to db.models.*
92
+ - db.models(path, waitForIndex) changed to db.models(path, { waitForIndex })
92
93
  - db._client moved to db.client
93
94
  - db._db moved to db.db
94
95
  - db.catch/then() moved to db.onError/db.onOpen()
95
96
  - next() is now redundant when returning promises from hooks, e.g. `afterFind: [async (data) => {...}]`
96
97
 
98
+ ## v2 Breaking Changes
99
+
100
+ - changed model.messages, array paths now must include '.$'
101
+ - updated AWS to client v3 (requires ES6 features, NodeJs >=14)
102
+
97
103
  ## Roadmap
98
104
 
99
105
  - Add Aggregate
package/lib/index.js CHANGED
@@ -174,14 +174,17 @@ Manager.prototype.isId = function(value) {
174
174
  return util.isId(value)
175
175
  }
176
176
 
177
- Manager.prototype.models = async function(pathname, waitForIndexes) {
177
+ Manager.prototype.models = async function(pathname, opts) {
178
178
  /**
179
179
  * Setup model definitions from a folder location
180
180
  * @param {string} pathname
181
+ * @param {object} opts:
182
+ * @param {boolean} opts.waitForIndexes - Wait for indexes to be created?
181
183
  * @return {Promise(object)} - e.g. { user: , article: , .. }
182
184
  * @this Manager
183
185
  */
184
186
  let out = {}
187
+ let { waitForIndexes } = opts || {}
185
188
  if (!pathname || typeof pathname !== 'string') {
186
189
  throw 'The path must be a valid pathname'
187
190
  }
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.0.8",
5
+ "version": "3.0.10",
6
6
  "license": "MIT",
7
7
  "repository": "github:boycce/monastery",
8
8
  "homepage": "https://boycce.github.io/monastery/",