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

search.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