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: 8123ef39830bf3f5ee27f07029765d00ebc1bdd5
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 29f57c12caee006f2434a0ef9b21aace9b30fdcf
Choose a head ref

Commits on Nov 2, 2022

  1. Copy the full SHA
    d962724 View commit details
  2. test: add test for gh-11943

    maciasello committed Nov 2, 2022
    Copy the full SHA
    4608748 View commit details
  3. Copy the full SHA
    f81f462 View commit details

Commits on Nov 14, 2022

  1. Copy the full SHA
    1a2d7f8 View commit details
  2. Copy the full SHA
    9ca46d1 View commit details
  3. Copy the full SHA
    8b306eb View commit details
  4. Copy the full SHA
    0cd01da View commit details

Commits on Dec 8, 2022

  1. Copy the full SHA
    a036c12 View commit details

Commits on Dec 9, 2022

  1. update tests

    JavaScriptBach committed Dec 9, 2022
    Copy the full SHA
    3611dd0 View commit details
  2. lint

    JavaScriptBach committed Dec 9, 2022
    Copy the full SHA
    8327ccf View commit details

Commits on Jan 10, 2023

  1. Copy the full SHA
    3160949 View commit details

Commits on Jan 14, 2023

  1. Merge pull request #12898 from 0x0a0d/fix-strict-return-all

    fix(cast): remove empty conditions after strict applied
    vkarpov15 authored Jan 14, 2023
    Copy the full SHA
    629b1ed View commit details

Commits on Jan 16, 2023

  1. Copy the full SHA
    1aa6fad View commit details

Commits on Jan 17, 2023

  1. Copy the full SHA
    c03d3ab View commit details
  2. Copy the full SHA
    d8ed2a6 View commit details
  3. Copy the full SHA
    a65781a View commit details
  4. test: some cleanup re: #12890

    vkarpov15 committed Jan 17, 2023
    Copy the full SHA
    386c366 View commit details
  5. fix some tests

    vkarpov15 committed Jan 17, 2023
    Copy the full SHA
    fb00ab6 View commit details
  6. Copy the full SHA
    474451a View commit details
  7. Update .gitignore

    IslandRhythms committed Jan 17, 2023
    Copy the full SHA
    6114228 View commit details
  8. Copy the full SHA
    0a35676 View commit details
  9. lint fix

    IslandRhythms committed Jan 17, 2023
    Copy the full SHA
    e7ab0fb View commit details
  10. docs(validation): fix dead links

    fixes  #12921
    pano9000 committed Jan 17, 2023
    Copy the full SHA
    21d5358 View commit details

Commits on Jan 18, 2023

  1. Copy the full SHA
    d222dd4 View commit details

Commits on Jan 19, 2023

  1. addressed comments

    IslandRhythms committed Jan 19, 2023
    Copy the full SHA
    c98f07b View commit details
  2. Update schema.js

    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    af20f0e View commit details
  3. Update schema.js

    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    c591139 View commit details
  4. Update schema.js

    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    0386d51 View commit details
  5. Update schema.js

    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    b74eff1 View commit details
  6. Update schema.test.js

    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    51e9313 View commit details
  7. Merge pull request #12920 from Automattic/IslandRhythms/removeVirtual

    feature: add `removeVirtual(path)` function to schema
    vkarpov15 authored Jan 19, 2023
    Copy the full SHA
    abdd928 View commit details
  8. Copy the full SHA
    74b5f00 View commit details
  9. style: fix lint

    vkarpov15 committed Jan 19, 2023
    Copy the full SHA
    d1dea8f View commit details

Commits on Jan 23, 2023

  1. Merge pull request #12922 from pano9000/docs_fix_deadurls-validation

    docs(validation): fix dead links
    hasezoey authored Jan 23, 2023
    Copy the full SHA
    f86e592 View commit details
  2. test(aggregate): increase timeout for a "beforeEach" hook

    because tests were failing because of this, hopefully this fixes it (or at least lowers it)
    hasezoey committed Jan 23, 2023
    Copy the full SHA
    2dd8bf3 View commit details
  3. Copy the full SHA
    48b5edb View commit details
  4. Copy the full SHA
    57fa99d View commit details
  5. Update test/collection.capped.test.js

    Co-authored-by: hasezoey <hasezoey@gmail.com>
    vkarpov15 and hasezoey authored Jan 23, 2023
    Copy the full SHA
    08f8559 View commit details
  6. Update test/collection.test.js

    Co-authored-by: hasezoey <hasezoey@gmail.com>
    vkarpov15 and hasezoey authored Jan 23, 2023
    Copy the full SHA
    bf2ad98 View commit details
  7. Copy the full SHA
    e1284a0 View commit details
  8. Merge branch 'vkarpov15/test-cleanup-12890' of github.com:Automattic/…

    …mongoose into vkarpov15/test-cleanup-12890
    vkarpov15 committed Jan 23, 2023
    Copy the full SHA
    3d5fa20 View commit details
  9. Copy the full SHA
    d4433f5 View commit details
  10. Merge pull request #12915 from Automattic/vkarpov15/gh-12902

    fix(query): correctly pass context when casting `$elemMatch`
    vkarpov15 authored Jan 23, 2023
    Copy the full SHA
    70d47ab View commit details
  11. Merge pull request #12937 from hasezoey/increaseTimeoutAggregate

    test(aggregate): increase timeout for a "beforeEach" hook
    vkarpov15 authored Jan 23, 2023
    Copy the full SHA
    8752e78 View commit details
  12. Copy the full SHA
    59e5338 View commit details
  13. Copy the full SHA
    32a0d08 View commit details
  14. Copy the full SHA
    90acf2b View commit details
  15. Merge pull request #12781 from JavaScriptBach/infer-null

    typescript: Allow null for optional document fields
    vkarpov15 authored Jan 23, 2023
    Copy the full SHA
    71d80e4 View commit details
  16. chore: release 6.8.5

    vkarpov15 committed Jan 23, 2023
    Copy the full SHA
    c190bd6 View commit details

Commits on Jan 24, 2023

  1. Copy the full SHA
    16072c2 View commit details
Showing with 5,559 additions and 2,788 deletions.
  1. +232 −0 .eslintrc.js
  2. +0 −194 .eslintrc.json
  3. +2 −2 .github/workflows/benchmark.yml
  4. +1 −1 .github/workflows/codeql.yml
  5. +3 −2 .github/workflows/documentation.yml
  6. +20 −33 .github/workflows/test.yml
  7. +2 −2 .github/workflows/tidelift-alignment.yml
  8. +4 −4 .github/workflows/tsd.yml
  9. +6 −1 .gitignore
  10. +184 −0 CHANGELOG.md
  11. +17 −17 README.md
  12. +70 −38 benchmarks/get.js
  13. +55 −0 benchmarks/mapOfSubdocs.js
  14. +4 −4 docs/advanced_schemas.md
  15. +7 −7 docs/api.pug
  16. +11 −11 docs/api_split.pug
  17. +31 −31 docs/async-await.md
  18. +6 −6 docs/change-streams.md
  19. +34 −0 docs/check-version.md
  20. +1 −1 docs/compatibility.md
  21. +26 −26 docs/connections.md
  22. +0 −3 docs/contributing.md
  23. +4 −4 docs/customschematypes.md
  24. +10 −10 docs/defaults.md
  25. +4 −4 docs/deprecations.md
  26. +11 −11 docs/discriminators.md
  27. +6 −6 docs/documents.md
  28. +3 −3 docs/enterprise.md
  29. +12 −10 docs/faq.md
  30. +8 −14 docs/geojson.md
  31. +148 −144 docs/guide.md
  32. +9 −6 docs/guides.md
  33. +14 −13 docs/includes/favicon.pug
  34. +1 −1 docs/includes/native.pug
  35. +6 −6 docs/index.md
  36. +6 −0 docs/jest.md
  37. +29 −28 docs/js/api-bold-current-nav.js
  38. +0 −6 docs/js/cookies.min.js
  39. +11 −10 docs/js/mobile-navbar-toggle.js
  40. +6 −7 docs/js/navbar-search.js
  41. +17 −16 docs/js/search.js
  42. +0 −4 docs/js/zepto.min.js
  43. +3 −13 docs/lambda.md
  44. +71 −65 docs/layout.pug
  45. +14 −6 docs/loadSponsorData.js
  46. +29 −28 docs/middleware.md
  47. +91 −89 docs/migrating_to_5.md
  48. +51 −40 docs/migrating_to_6.md
  49. +6 −6 docs/migration.md
  50. +8 −8 docs/models.md
  51. +12 −12 docs/plugins.md
  52. +49 −48 docs/populate.md
  53. +0 −8 docs/prior.pug
  54. +10 −10 docs/promises.md
  55. +27 −27 docs/queries.md
  56. +88 −48 docs/schematypes.md
  57. +3 −3 docs/search.pug
  58. +107 −40 docs/source/api.js
  59. +5 −5 docs/source/home.js
  60. +75 −44 docs/source/index.js
  61. +8 −0 docs/source/tutorials.js
  62. +7 −0 docs/source/typescript.js
  63. +29 −0 docs/source/utils.js
  64. +0 −29 docs/splitApiDocs.js
  65. +3 −3 docs/sponsors.pug
  66. +21 −24 docs/subdocs.md
  67. +9 −9 docs/timestamps.md
  68. +26 −13 docs/transactions.md
  69. +3 −3 docs/tutorials/custom-casting.md
  70. +6 −6 docs/tutorials/dates.md
  71. +9 −9 docs/tutorials/findoneandupdate.md
  72. +23 −14 docs/tutorials/getters-setters.md
  73. +0 −15 docs/tutorials/index.js
  74. +10 −10 docs/tutorials/lean.md
  75. +10 −12 docs/tutorials/query_casting.md
  76. +4 −5 docs/tutorials/ssl.md
  77. +6 −6 docs/tutorials/virtuals.md
  78. +5 −5 docs/typescript.md
  79. +0 −14 docs/typescript/index.js
  80. +4 −4 docs/typescript/query-helpers.md
  81. +6 −6 docs/typescript/schemas.md
  82. +3 −2 docs/typescript/statics-and-methods.md
  83. +2 −2 docs/typescript/statics.md
  84. +5 −5 docs/typescript/virtuals.md
  85. +40 −39 docs/validation.md
  86. +27 −0 docs/version-support.md
  87. +1 −1 examples/aggregate/aggregate.js
  88. +1 −1 examples/geospatial/geospatial.js
  89. +2 −3 index.pug
  90. +42 −43 lib/aggregate.js
  91. +2 −1 lib/cast.js
  92. +16 −6 lib/connection.js
  93. +2 −2 lib/cursor/AggregationCursor.js
  94. +16 −1 lib/cursor/ChangeStream.js
  95. +3 −2 lib/cursor/QueryCursor.js
  96. +155 −85 lib/document.js
  97. +25 −6 lib/drivers/node-mongodb-native/collection.js
  98. +21 −10 lib/error/index.js
  99. +1 −1 lib/error/objectParameter.js
  100. +1 −1 lib/error/serverSelection.js
  101. +2 −1 lib/helpers/discriminator/mergeDiscriminatorSchema.js
  102. +17 −4 lib/helpers/document/applyDefaults.js
  103. +11 −1 lib/helpers/document/compile.js
  104. +0 −39 lib/helpers/path/flattenObjectWithDottedPaths.js
  105. +15 −11 lib/helpers/printJestWarning.js
  106. +4 −3 lib/helpers/processConnectionOptions.js
  107. +1 −0 lib/helpers/projection/hasIncludedChildren.js
  108. +8 −0 lib/helpers/projection/isNestedProjection.js
  109. +1 −1 lib/helpers/query/cast$expr.js
  110. +1 −12 lib/helpers/query/castUpdate.js
  111. +0 −1 lib/helpers/schema/getPath.js
  112. +38 −10 lib/index.js
  113. +210 −111 lib/model.js
  114. +206 −198 lib/query.js
  115. +106 −8 lib/schema.js
  116. +100 −0 lib/schema/DocumentArrayElement.js
  117. +7 −5 lib/schema/SubdocumentPath.js
  118. +8 −8 lib/schema/array.js
  119. +10 −19 lib/schema/documentarray.js
  120. +1 −1 lib/schema/operators/text.js
  121. +17 −12 lib/schema/uuid.js
  122. +5 −2 lib/schematype.js
  123. +1 −1 lib/types/ArraySubdocument.js
  124. +1 −1 lib/types/array/index.js
  125. +12 −13 lib/types/array/methods/index.js
  126. +1 −1 lib/types/buffer.js
  127. +25 −11 lib/types/map.js
  128. +3 −3 lib/types/subdocument.js
  129. +2 −0 lib/utils.js
  130. +1 −1 lib/virtualtype.js
  131. +37 −22 package.json
  132. +34 −25 docs/search.js → scripts/generateSearch.js
  133. +11 −2 scripts/static.js
  134. +230 −35 scripts/website.js
  135. +2 −1 test/.eslintrc.yml
  136. +1 −0 test/aggregate.test.js
  137. +9 −10 test/collection.capped.test.js
  138. +23 −9 test/collection.test.js
  139. +60 −23 test/connection.test.js
  140. +27 −31 test/deno.js
  141. +54 −0 test/deno_mocha.js
  142. +5 −5 test/docs/asyncIterator.test.js
  143. +2 −2 test/docs/cast.test.js
  144. +2 −2 test/docs/date.test.js
  145. +22 −4 test/docs/debug.test.js
  146. +2 −2 test/docs/defaults.test.js
  147. +5 −5 test/docs/discriminators.test.js
  148. +7 −7 test/docs/findoneandupdate.test.js
  149. +9 −6 test/docs/getters-setters.test.js
  150. +3 −3 test/docs/lean.test.js
  151. +24 −24 test/docs/promises.test.js
  152. +2 −2 test/docs/schemas.test.js
  153. +22 −23 test/docs/transactions.test.js
  154. +4 −4 test/docs/validation.test.js
  155. +5 −6 test/docs/virtuals.test.js
  156. +53 −0 test/document.modified.test.js
  157. +408 −7 test/document.test.js
  158. +32 −0 test/index.test.js
  159. +6 −0 test/mocha-fixtures.js
  160. +21 −0 test/model.discriminator.querying.test.js
  161. +69 −0 test/model.discriminator.test.js
  162. +0 −1 test/model.findOneAndReplace.test.js
  163. +10 −0 test/model.findOneAndUpdate.test.js
  164. +66 −0 test/model.indexes.test.js
  165. +60 −0 test/model.populate.test.js
  166. +224 −106 test/model.test.js
  167. +31 −2 test/model.update.test.js
  168. +79 −0 test/model.watch.test.js
  169. +24 −0 test/query.cursor.test.js
  170. +0 −6 test/query.middleware.test.js
  171. +79 −11 test/query.test.js
  172. +159 −9 test/schema.test.js
  173. +50 −2 test/schema.uuid.test.js
  174. +68 −5 test/schema.validation.test.js
  175. +18 −0 test/types.documentarray.test.js
  176. +1 −0 test/types.map.test.js
  177. +8 −15 test/types.subdocument.test.js
  178. +2 −0 test/types/.eslintrc.yml
  179. +5 −5 test/types/PipelineStage.test.ts
  180. +7 −0 test/types/expressions.test.ts
  181. +1 −1 test/types/lean.test.ts
  182. +57 −3 test/types/models.test.ts
  183. +17 −0 test/types/mongo.test.ts
  184. +30 −0 test/types/populate.test.ts
  185. +8 −0 test/types/querycursor.test.ts
  186. +32 −0 test/types/subdocuments.test.ts
  187. +2 −2 test/virtualtype.test.js
  188. +4 −67 types/aggregate.d.ts
  189. +9 −0 types/augmentations.d.ts
  190. +4 −4 types/connection.d.ts
  191. +4 −4 types/cursor.d.ts
  192. +1 −1 types/document.d.ts
  193. +5 −0 types/error.d.ts
  194. +154 −153 types/expressions.d.ts
  195. +9 −6 types/index.d.ts
  196. +38 −11 types/models.d.ts
  197. +8 −1 types/mongooseoptions.d.ts
  198. +39 −35 types/pipelinestage.d.ts
  199. +10 −10 types/query.d.ts
  200. +1 −1 types/schematypes.d.ts
  201. +4 −4 types/session.d.ts
  202. +1 −1 types/types.d.ts
  203. +1 −0 types/validation.d.ts
232 changes: 232 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
'use strict';

module.exports = {
extends: [
'eslint:recommended'
],
ignorePatterns: [
'tools',
'dist',
'website.js',
'test/files/*',
'benchmarks',
'*.min.js',
'docs/js/native.js'
],
overrides: [
{
files: [
'**/*.{ts,tsx}',
'**/*.md/*.ts',
'**/*.md/*.typescript'
],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
plugins: [
'@typescript-eslint'
],
rules: {
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'spaced-comment': [
'error',
'always',
{
block: {
markers: [
'!'
],
balanced: true
},
markers: [
'/'
]
}
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': [
'warn',
2,
{
SwitchCase: 1,
ignoredNodes: ['TSTypeParameterInstantiation']
}
],
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/object-curly-spacing': [
'error',
'always'
],
'@typescript-eslint/semi': 'error',
'@typescript-eslint/space-before-function-paren': [
'error',
'never'
],
'@typescript-eslint/space-infix-ops': 'off'
}
},
{
files: [
'docs/js/**/*.js'
],
env: {
node: false,
browser: true
}
}
// // eslint-plugin-markdown has been disabled because of out-standing issues, see https://github.com/eslint/eslint-plugin-markdown/issues/214
// {
// files: ['**/*.md'],
// processor: 'markdown/markdown'
// },
// {
// files: ['**/*.md/*.js', '**/*.md/*.javascript', '**/*.md/*.ts', '**/*.md/*.typescript'],
// parserOptions: {
// ecmaFeatures: {
// impliedStrict: true
// },
// sourceType: 'module', // required to allow "import" statements
// ecmaVersion: 'latest' // required to allow top-level await
// },
// rules: {
// 'no-undef': 'off',
// 'no-unused-expressions': 'off',
// 'no-unused-vars': 'off',
// 'no-redeclare': 'off',
// '@typescript-eslint/no-redeclare': 'off'
// }
// }
],
plugins: [
'mocha-no-only'
// 'markdown'
],
parserOptions: {
ecmaVersion: 2020
},
env: {
node: true,
es6: true
},
rules: {
'comma-style': 'error',
indent: [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 2
}
],
'keyword-spacing': 'error',
'no-whitespace-before-property': 'error',
'no-buffer-constructor': 'warn',
'no-console': 'off',
'no-constant-condition': 'off',
'no-multi-spaces': 'error',
'func-call-spacing': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-unneeded-ternary': 'error',
'no-const-assign': 'error',
'no-useless-rename': 'error',
'no-dupe-keys': 'error',
'space-in-parens': [
'error',
'never'
],
'spaced-comment': [
'error',
'always',
{
block: {
markers: [
'!'
],
balanced: true
}
}
],
'key-spacing': [
'error',
{
beforeColon: false,
afterColon: true
}
],
'comma-spacing': [
'error',
{
before: false,
after: true
}
],
'array-bracket-spacing': 1,
'arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'object-curly-spacing': [
'error',
'always'
],
'comma-dangle': [
'error',
'never'
],
'no-unreachable': 'error',
quotes: [
'error',
'single'
],
'quote-props': [
'error',
'as-needed'
],
semi: 'error',
'no-extra-semi': 'error',
'semi-spacing': 'error',
'no-spaced-func': 'error',
'no-throw-literal': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
'never'
],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'no-var': 'warn',
'prefer-const': 'warn',
strict: [
'error',
'global'
],
'no-restricted-globals': [
'error',
{
name: 'context',
message: 'Don\'t use Mocha\'s global context'
}
],
'no-prototype-builtins': 'off',
'mocha-no-only/mocha-no-only': [
'error'
],
'no-empty': 'off',
'eol-last': 'warn',
'no-multiple-empty-lines': ['warn', { max: 2 }]
}
};
Loading