Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Automattic/mongoose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.4.20
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.6.8
Choose a head ref

Commits on Apr 25, 2017

  1. Copy the full SHA
    7bcc172 View commit details

Commits on Feb 6, 2019

  1. feat(document): validateUpdatedOnly option. only validates modified

    schema option that can be overridden on validate, validateSync, and save
    captaincaius committed Feb 6, 2019
    Copy the full SHA
    e85997e View commit details

Commits on Feb 14, 2019

  1. Merge pull request #7492 from captaincaius/feat/validate-updated-only

    feat(document): validateUpdatedOnly option. only validates modified
    vkarpov15 authored Feb 14, 2019
    Copy the full SHA
    12fe73a View commit details

Commits on Feb 19, 2019

  1. Copy the full SHA
    e72a00e View commit details
  2. chore(mongoose): deprecate global.MONGOOSE_DRIVER_PATH so we can be w…

    …ebpack-warning-free in 6.0
    
    Fix #7501
    Re: #7476
    vkarpov15 committed Feb 19, 2019
    Copy the full SHA
    605aaa5 View commit details
  3. test: fix tests

    vkarpov15 committed Feb 19, 2019
    Copy the full SHA
    c2ffade View commit details
  4. chore: use regular assert

    vkarpov15 committed Feb 19, 2019
    Copy the full SHA
    958306a View commit details
  5. perf(buffer): use symbols instead of Object.defineProperty() to make …

    …_path and _parent not show up in Object.keys()
    
    Fix #7331
    vkarpov15 committed Feb 19, 2019
    Copy the full SHA
    b869df9 View commit details

Commits on Feb 24, 2019

  1. Copy the full SHA
    f000ccf View commit details
  2. Copy the full SHA
    93af7d4 View commit details

Commits on Mar 7, 2019

  1. Copy the full SHA
    2134f5f View commit details
  2. test: fix tests

    vkarpov15 committed Mar 7, 2019
    Copy the full SHA
    ebc45bc View commit details
  3. Copy the full SHA
    448b451 View commit details
  4. Copy the full SHA
    c760ae0 View commit details
  5. Copy the full SHA
    ead0e91 View commit details

Commits on Mar 8, 2019

  1. Copy the full SHA
    9e674cf View commit details
  2. Copy the full SHA
    4b10145 View commit details
  3. 1
    Copy the full SHA
    2cca743 View commit details
  4. Copy the full SHA
    e940553 View commit details
  5. Copy the full SHA
    b648841 View commit details
  6. Copy the full SHA
    b7a1fd4 View commit details
  7. Copy the full SHA
    b6b1524 View commit details

Commits on Mar 25, 2019

  1. Copy the full SHA
    2cf5335 View commit details
  2. Copy the full SHA
    58aa46b View commit details
  3. Copy the full SHA
    a447e46 View commit details
  4. Copy the full SHA
    fffb5bd View commit details
  5. Copy the full SHA
    436e5a5 View commit details

Commits on Mar 26, 2019

  1. Copy the full SHA
    c5aada8 View commit details
  2. Copy the full SHA
    1d1f504 View commit details
  3. Copy the full SHA
    5d07375 View commit details

Commits on Mar 27, 2019

  1. Minor changes to doc ("atomic" keyword made consistent)

    720degreeLotus committed Mar 27, 2019
    Copy the full SHA
    61c6d19 View commit details
  2. Copy the full SHA
    2c469ca View commit details
  3. test(update): repro #7603

    vkarpov15 committed Mar 27, 2019
    Copy the full SHA
    62f2542 View commit details
  4. Copy the full SHA
    b1fe2fe View commit details
  5. test(document): repro #7645

    vkarpov15 committed Mar 27, 2019
    Copy the full SHA
    3cba9ec View commit details
  6. Copy the full SHA
    452aad6 View commit details
  7. style: fix lint

    vkarpov15 committed Mar 27, 2019
    Copy the full SHA
    c9f68bc View commit details

Commits on May 23, 2019

  1. Copy the full SHA
    eda7cac View commit details
  2. refactor(populate): allow arbitrary options to populate without modif…

    …ying positional args
    
    Re: #6520
    vkarpov15 committed May 23, 2019
    Copy the full SHA
    a33c82e View commit details
  3. test: fix tests re: #6520

    vkarpov15 committed May 23, 2019
    Copy the full SHA
    1efe40b View commit details
  4. test: fix tests re: #6520

    vkarpov15 committed May 23, 2019
    Copy the full SHA
    1897b6a View commit details
  5. feat(populate): support PopulateOptions#connection option to allow …

    …cross-db populate with refPath
    
    Fix #6520
    vkarpov15 committed May 23, 2019
    Copy the full SHA
    4129123 View commit details
  6. Copy the full SHA
    13f8073 View commit details
  7. Copy the full SHA
    baf8cba View commit details
  8. Copy the full SHA
    4d4286b View commit details

Commits on May 25, 2019

  1. Copy the full SHA
    ade5399 View commit details
  2. fix: avoid setting PopulateOptions#model to prevent confusion betwe…

    …en internal `model` and user-specified `model`
    
    Fix #6520
    vkarpov15 committed May 25, 2019
    Copy the full SHA
    e493bc5 View commit details
  3. Copy the full SHA
    2cc022d View commit details

Commits on May 31, 2019

  1. Copy the full SHA
    f14c706 View commit details
  2. Copy the full SHA
    da4688b View commit details
Showing with 21,074 additions and 5,399 deletions.
  1. +5 −0 .github/FUNDING.yml
  2. +1 −1 .github/PULL_REQUEST_TEMPLATE.md
  3. +1 −1 .npmignore
  4. +1 −1 .travis.yml
  5. +1 −1 CONTRIBUTING.md
  6. +309 −4 History.md
  7. +21 −0 LICENSE.md
  8. +4 −2 Makefile
  9. +25 −6 README.md
  10. +1 −1 docs/3.0.x/docs/api.jade
  11. +1 −1 docs/3.0.x/docs/guide.jade
  12. +1 −1 docs/3.0.x/docs/index.jade
  13. +1 −1 docs/3.0.x/docs/layout.jade
  14. +1 −1 docs/3.1.x/docs/api.jade
  15. +1 −1 docs/3.1.x/docs/guide.jade
  16. +1 −1 docs/3.1.x/docs/index.jade
  17. +1 −1 docs/3.1.x/docs/layout.jade
  18. +1 −1 docs/3.2.x/docs/api.jade
  19. +1 −1 docs/3.2.x/docs/guide.jade
  20. +1 −1 docs/3.2.x/docs/index.jade
  21. +1 −1 docs/3.2.x/docs/layout.jade
  22. +1 −1 docs/3.3.x/docs/api.jade
  23. +1 −1 docs/3.3.x/docs/guide.jade
  24. +1 −1 docs/3.3.x/docs/index.jade
  25. +1 −1 docs/3.3.x/docs/layout.jade
  26. +1 −1 docs/3.3.x/docs/website.js
  27. +1 −1 docs/3.4.x/docs/website.js
  28. +0 −19 docs/acquit.jade
  29. +15 −0 docs/acquit.pug
  30. +13 −22 docs/advanced_schemas.html
  31. +555 −313 docs/api.html
  32. +8 −8 docs/{api.jade → api.pug}
  33. +388 −0 docs/api/aggregate.html
  34. +105 −0 docs/api/aggregationcursor.html
  35. +65 −0 docs/api/array.html
  36. +219 −0 docs/api/connection.html
  37. +558 −0 docs/api/document.html
  38. +92 −0 docs/api/error.html
  39. +1,329 −0 docs/api/model.html
  40. +317 −0 docs/api/mongoose.html
  41. +84 −0 docs/api/mongooseerror.html
  42. +1,600 −0 docs/api/query.html
  43. +103 −0 docs/api/querycursor.html
  44. +426 −0 docs/api/schema.html
  45. +498 −0 docs/api/schematype.html
  46. +78 −0 docs/api/singlenestedpath.html
  47. +124 −0 docs/api/virtualtype.html
  48. +85 −0 docs/api_split.pug
  49. +168 −0 docs/async-await.pug
  50. +27 −68 docs/browser.html
  51. +11 −47 docs/{browser.jade → browser.pug}
  52. +10 −18 docs/compatibility.html
  53. 0 docs/{compatibility.jade → compatibility.pug}
  54. +39 −67 docs/connections.html
  55. +35 −3 docs/{connections.jade → connections.pug}
  56. +10 −18 docs/contributing.html
  57. 0 docs/{contributing.jade → contributing.pug}
  58. +2 −2 docs/css/api.css
  59. +31 −36 docs/css/mongoose5.css
  60. +13 −22 docs/customschematypes.html
  61. +25 −37 docs/defaults.html
  62. +41 −65 docs/deprecations.html
  63. +2 −1 docs/{deprecations.jade → deprecations.pug}
  64. +48 −65 docs/discriminators.html
  65. +24 −48 docs/documents.html
  66. +0 −13 docs/{documents.jade → documents.pug}
  67. +50 −78 docs/faq.html
  68. +2 −2 docs/{faq.jade → faq.pug}
  69. +57 −65 docs/further_reading.html
  70. 0 docs/{further_reading.jade → further_reading.pug}
  71. +35 −79 docs/geojson.html
  72. +11 −47 docs/{geojson.jade → geojson.pug}
  73. +158 −214 docs/guide.html
  74. +48 −37 docs/{guide.jade → guide.pug}
  75. +24 −60 docs/guides.html
  76. +16 −47 docs/{guides.jade → guides.pug}
  77. BIN docs/images/dk.png
  78. 0 docs/includes/{favicon.jade → favicon.pug}
  79. 0 docs/includes/{googlesearch.jade → googlesearch.pug}
  80. +0 −18 docs/includes/keen.jade
  81. 0 docs/includes/{nav.jade → nav.pug}
  82. +10 −0 docs/includes/track.pug
  83. +31 −90 docs/index.html
  84. +0 −49 docs/{index.jade → index.pug}
  85. +27 −68 docs/jest.html
  86. +11 −47 docs/{jest.jade → jest.pug}
  87. +1 −1 docs/js/navbar-search.js
  88. +25 −66 docs/lambda.html
  89. +11 −47 docs/{lambda.jade → lambda.pug}
  90. +17 −16 docs/{layout.jade → layout.pug}
  91. +42 −66 docs/middleware.html
  92. 0 docs/{middleware.jade → middleware.pug}
  93. +55 −83 docs/migrating_to_5.html
  94. 0 docs/{migrating_to_5.jade → migrating_to_5.pug}
  95. +14 −23 docs/migration.html
  96. 0 docs/{migration.jade → migration.pug}
  97. +28 −45 docs/models.html
  98. 0 docs/{models.jade → models.pug}
  99. +15 −25 docs/plugins.html
  100. +35 −28 docs/{plugins.jade → plugins.pug}
  101. +71 −107 docs/populate.html
  102. 0 docs/{populate.jade → populate.pug}
  103. +9 −17 docs/prior.html
  104. 0 docs/{prior.jade → prior.pug}
  105. +9 −17 docs/production.html
  106. 0 docs/{production.jade → production.pug}
  107. +21 −32 docs/promises.html
  108. +20 −33 docs/queries.html
  109. 0 docs/{queries.jade → queries.pug}
  110. +2 −2 docs/{redirect.jade → redirect.pug}
  111. +65 −100 docs/schematypes.html
  112. +1 −1 docs/{schematypes.jade → schematypes.pug}
  113. +100 −0 docs/search.html
  114. +12 −4 docs/search.js
  115. 0 docs/{search.jade → search.pug}
  116. +0 −3 docs/source/acquit.js
  117. +12 −5 docs/source/api.js
  118. +29 −29 docs/source/index.js
  119. +21 −0 docs/splitApiDocs.js
  120. +58 −43 docs/subdocs.html
  121. +43 −0 docs/{subdocs.jade → subdocs.pug}
  122. +45 −72 docs/transactions.html
  123. +34 −47 docs/{transactions.jade → transactions.pug}
  124. +102 −0 docs/tutorials/custom-casting.html
  125. +17 −0 docs/tutorials/custom-casting.md
  126. +26 −42 docs/tutorials/dates.html
  127. +136 −0 docs/tutorials/findoneandupdate.html
  128. +41 −0 docs/tutorials/findoneandupdate.md
  129. +181 −0 docs/tutorials/getters-setters.html
  130. +83 −0 docs/tutorials/getters-setters.md
  131. +28 −44 docs/tutorials/lean.html
  132. +28 −2 docs/tutorials/lean.md
  133. +140 −0 docs/tutorials/query_casting.html
  134. +49 −0 docs/tutorials/query_casting.md
  135. +215 −0 docs/tutorials/virtuals.html
  136. +106 −0 docs/tutorials/virtuals.md
  137. +88 −86 docs/validation.html
  138. +0 −45 docs/website.js
  139. +2 −0 examples/redis-todo/.eslintrc.yml
  140. +7 −0 examples/redis-todo/db/index.js
  141. +11 −0 examples/redis-todo/db/models/todoModel.js
  142. +48 −0 examples/redis-todo/db/models/userModel.js
  143. +18 −0 examples/redis-todo/middleware/auth.js
  144. +9 −0 examples/redis-todo/middleware/clearCache.js
  145. +2,524 −0 examples/redis-todo/package-lock.json
  146. +38 −0 examples/redis-todo/package.json
  147. +69 −0 examples/redis-todo/routers/todoRouter.js
  148. +93 −0 examples/redis-todo/routers/userRouter.js
  149. +25 −0 examples/redis-todo/server.js
  150. +46 −0 examples/redis-todo/services/cache.js
  151. +41 −31 index.html
  152. +49 −21 index.jade → index.pug
  153. +28 −15 lib/aggregate.js
  154. +1 −1 lib/browser.js
  155. +1 −1 lib/browserDocument.js
  156. +3 −3 lib/cast.js
  157. +3 −1 lib/cast/string.js
  158. +130 −13 lib/connection.js
  159. +4 −0 lib/cursor/ChangeStream.js
  160. +358 −100 lib/document.js
  161. +24 −12 lib/drivers/node-mongodb-native/collection.js
  162. +4 −1 lib/drivers/node-mongodb-native/connection.js
  163. +1 −1 lib/drivers/node-mongodb-native/index.js
  164. +1 −1 lib/error/cast.js
  165. +62 −0 lib/error/index.js
  166. +3 −33 lib/error/mongooseError.js
  167. +6 −3 lib/error/notFound.js
  168. +3 −1 lib/helpers/common.js
  169. +25 −0 lib/helpers/discriminator/getConstructor.js
  170. +4 −1 lib/helpers/document/cleanModifiedSubpaths.js
  171. +24 −1 lib/helpers/document/compile.js
  172. +5 −5 lib/helpers/document/getEmbeddedDiscriminatorPath.js
  173. +7 −2 lib/helpers/model/applyHooks.js
  174. +71 −0 lib/helpers/model/applyStaticHooks.js
  175. +7 −3 lib/helpers/model/castBulkWrite.js
  176. +27 −11 lib/helpers/model/discriminator.js
  177. +23 −6 lib/helpers/populate/assignVals.js
  178. +412 −0 lib/helpers/populate/getModelsMapForPopulate.js
  179. +21 −4 lib/helpers/populate/getSchemaTypes.js
  180. +1 −1 lib/helpers/projection/isInclusive.js
  181. +15 −0 lib/helpers/query/applyGlobalMaxTimeMS.js
  182. +6 −2 lib/helpers/query/applyQueryMiddleware.js
  183. +2 −2 lib/helpers/query/castFilterPath.js
  184. +43 −12 lib/helpers/query/castUpdate.js
  185. +18 −0 lib/helpers/query/handleImmutable.js
  186. +1 −1 lib/helpers/query/hasDollarKeys.js
  187. +45 −0 lib/helpers/schema/applyPlugins.js
  188. +1 −1 lib/helpers/schema/cleanPositionalOperators.js
  189. +35 −0 lib/helpers/schema/getPath.js
  190. +1 −1 lib/helpers/schema/merge.js
  191. +0 −41 lib/helpers/schema/setParentPointers.js
  192. +28 −0 lib/helpers/schematype/handleImmutable.js
  193. +6 −3 lib/helpers/setDefaultsOnInsert.js
  194. +12 −11 lib/helpers/symbols.js
  195. +28 −18 lib/helpers/update/applyTimestampsToChildren.js
  196. +16 −2 lib/helpers/update/castArrayFilters.js
  197. +3 −3 lib/helpers/updateValidators.js
  198. +91 −57 lib/index.js
  199. +1 −0 lib/internal.js
  200. +525 −493 lib/model.js
  201. +30 −0 lib/options/PopulateOptions.js
  202. +14 −0 lib/options/removeOptions.js
  203. +1 −1 lib/plugins/sharding.js
  204. +7 −1 lib/plugins/validateBeforeSave.js
  205. +368 −103 lib/query.js
  206. +15 −6 lib/queryhelpers.js
  207. +212 −66 lib/schema.js
  208. +43 −70 lib/schema/{embedded.js → SingleNestedPath.js}
  209. +83 −10 lib/schema/array.js
  210. +3 −1 lib/schema/buffer.js
  211. +1 −1 lib/schema/date.js
  212. +3 −1 lib/schema/decimal128.js
  213. +40 −38 lib/schema/documentarray.js
  214. +1 −1 lib/schema/index.js
  215. +8 −2 lib/schema/map.js
  216. +4 −2 lib/schema/number.js
  217. +3 −1 lib/schema/objectid.js
  218. +5 −3 lib/schema/string.js
  219. +137 −25 lib/schematype.js
  220. +22 −803 lib/types/array.js
  221. +8 −34 lib/types/buffer.js
  222. +863 −0 lib/types/core_array.js
  223. +26 −39 lib/types/documentarray.js
  224. +5 −5 lib/types/embedded.js
  225. +12 −1 lib/types/map.js
  226. +28 −2 lib/types/subdocument.js
  227. +184 −84 lib/utils.js
  228. +35 −16 lib/virtualtype.js
  229. +26 −26 package.json
  230. +47 −2 test/aggregate.test.js
  231. +8 −2 test/cast.test.js
  232. +27 −6 test/collection.test.js
  233. +7 −1 test/common.js
  234. +34 −1 test/connection.test.js
  235. +64 −0 test/docs/custom-casting.test.js
  236. +35 −3 test/docs/discriminators.test.js
  237. +1 −1 test/docs/promises.test.js
  238. +18 −2 test/docs/transactions.test.js
  239. +54 −13 test/docs/validation.test.js
  240. +1 −1 test/document.isselected.test.js
  241. +113 −15 test/document.populate.test.js
  242. +853 −9 test/document.test.js
  243. +1 −1 test/errors.validation.test.js
  244. +7 −0 test/es-next.test.js
  245. +155 −0 test/es-next/cast.test.es6.js
  246. +124 −0 test/es-next/findoneandupdate.test.es6.js
  247. +177 −0 test/es-next/getters-setters.test.es6.js
  248. +1 −1 test/es-next/lean.test.es6.js
  249. +174 −0 test/es-next/virtuals.test.es6.js
  250. +25 −0 test/helpers/schema.getPath.test.js
  251. +2 −2 test/helpers/setDefaultsOnInsert.test.js
  252. +53 −0 test/helpers/update.castArrayFilters.test.js
  253. +1 −1 test/model.create.test.js
  254. +121 −14 test/model.discriminator.test.js
  255. +3 −3 test/model.field.selection.test.js
  256. +72 −36 test/model.findOneAndReplace.test.js
  257. +115 −6 test/model.findOneAndUpdate.test.js
  258. +80 −1 test/model.middleware.test.js
  259. +356 −13 test/model.populate.test.js
  260. +11 −0 test/model.query.casting.test.js
  261. +1 −1 test/model.querying.test.js
  262. +250 −13 test/model.test.js
  263. +43 −0 test/model.update.test.js
  264. +26 −1 test/query.middleware.test.js
  265. +108 −24 test/query.test.js
  266. +24 −0 test/schema.documentarray.test.js
  267. +26 −0 test/schema.select.test.js
  268. +111 −4 test/schema.test.js
  269. +1 −1 test/schema.timestamps.test.js
  270. +19 −0 test/schema.type.test.js
  271. +27 −2 test/schema.validation.test.js
  272. +1 −1 test/shard.test.js
  273. +78 −0 test/timestamps.test.js
  274. +52 −2 test/types.array.test.js
  275. +1 −1 test/types.buffer.test.js
  276. +3 −3 test/types.document.test.js
  277. +29 −1 test/types.documentarray.test.js
  278. +141 −0 test/types.map.test.js
  279. +15 −1 test/updateValidators.unit.test.js
  280. +26 −11 website.js
5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are supported funding model platforms

github: vkarpov15
open_collective: mongoose
tidelift: npm/mongoose
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory.

If you're making a change to documentation, do **not** modify a `.html` file directly. Instead find the corresponding `.jade` file or test case in the `test/docs` directory.
If you're making a change to documentation, do **not** modify a `.html` file directly. Instead find the corresponding `.pug` file or test case in the `test/docs` directory.

**Summary**

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ test/
Makefile
CNAME
index.html
index.jade
index.pug
bin/
tools/31*
*.key
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
sudo: false
node_js: [11, 10, 9, 8, 7, 6, 5, 4]
node_js: [12, 11, 10, 9, 8, 7, 6, 5, 4]
install:
- travis_retry npm install
before_script:
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ If you have a question about Mongoose (not a bug report) please post it to eithe

To contribute to the [API documentation](http://mongoosejs.com/docs/api.html) just make your changes to the inline documentation of the appropriate [source code](https://github.com/Automattic/mongoose/tree/master/lib) in the master branch and submit a [pull request](https://help.github.com/articles/using-pull-requests/). You might also use the github [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.

To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick start](http://mongoosejs.com/docs/index.html) docs, make your changes to the appropriate `.jade` files in the [docs](https://github.com/Automattic/mongoose/tree/master/docs) directory of the master branch and submit a pull request. Again, the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button might work for you here.
To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick start](http://mongoosejs.com/docs/index.html) docs, make your changes to the appropriate `.pug` files in the [docs](https://github.com/Automattic/mongoose/tree/master/docs) directory of the master branch and submit a pull request. Again, the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button might work for you here.

If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute:

Loading