mongoose 6.13.10 → 6.13.11

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.
Files changed (3) hide show
  1. package/deno.lock +61 -0
  2. package/lib/query.js +15 -5
  3. package/package.json +1 -1
package/deno.lock ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "version": "5",
3
+ "redirects": {
4
+ "https://deno.land/std/flags/mod.ts": "https://deno.land/std@0.224.0/flags/mod.ts"
5
+ },
6
+ "remote": {
7
+ "https://deno.land/std@0.224.0/assert/assert_exists.ts": "43420cf7f956748ae6ed1230646567b3593cb7a36c5a5327269279c870c5ddfd",
8
+ "https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917",
9
+ "https://deno.land/std@0.224.0/flags/mod.ts": "88553267f34519c8982212185339efdb2d2e62c159ec558f47eb50c8952a6be3"
10
+ },
11
+ "workspace": {
12
+ "packageJson": {
13
+ "dependencies": [
14
+ "npm:@ark/attest@0.56.3",
15
+ "npm:@eslint/js@^9.39.3",
16
+ "npm:@mongodb-js/mongodb-downloader@1",
17
+ "npm:@standard-schema/spec@^1.1.0",
18
+ "npm:@types/node@^20.19.0",
19
+ "npm:acquit-ignore@0.2.2",
20
+ "npm:acquit-require@0.1.1",
21
+ "npm:acquit@1.4.0",
22
+ "npm:ajv@8.20.0",
23
+ "npm:c8@11.0.0",
24
+ "npm:cheerio@1.2.0",
25
+ "npm:dox@1.0.0",
26
+ "npm:eslint-plugin-mocha-no-only@1.2.0",
27
+ "npm:eslint@10.8.0",
28
+ "npm:express@5.2.1",
29
+ "npm:fs-extra@11.4",
30
+ "npm:glob@^13.0.6",
31
+ "npm:globals@^17.4.0",
32
+ "npm:highlight.js@11.11.1",
33
+ "npm:kareem@3.3.0",
34
+ "npm:linkinator@8",
35
+ "npm:lodash.isequal@4.5.0",
36
+ "npm:lodash.isequalwith@4.4.0",
37
+ "npm:markdownlint-cli2@0.23.2",
38
+ "npm:marked@18.0.7",
39
+ "npm:mkdirp@^3.0.1",
40
+ "npm:mocha@12.0.0-rc.5",
41
+ "npm:moment@2.30.1",
42
+ "npm:mongodb-client-encryption@^7.2.0",
43
+ "npm:mongodb-memory-server@11.2.0",
44
+ "npm:mongodb-runner@6",
45
+ "npm:mongodb@7.5",
46
+ "npm:mpath@0.9.0",
47
+ "npm:mquery@6.0.0",
48
+ "npm:ms@2.1.3",
49
+ "npm:ncp@2",
50
+ "npm:pug@3.0.4",
51
+ "npm:sift@17.1.3",
52
+ "npm:sinon@22.1.0",
53
+ "npm:tstyche@7",
54
+ "npm:typescript-eslint@^8.31.1",
55
+ "npm:typescript@5.9.3",
56
+ "npm:uuid@14.0.1",
57
+ "npm:xss@1.0.15"
58
+ ]
59
+ }
60
+ }
61
+ }
package/lib/query.js CHANGED
@@ -2639,9 +2639,11 @@ Query.prototype.findOne = function(conditions, projection, options, callback) {
2639
2639
 
2640
2640
  Query.prototype._count = wrapThunk(function(callback) {
2641
2641
  try {
2642
- this.cast(this.model);
2642
+ this._castConditions();
2643
2643
  } catch (err) {
2644
- this.error(err);
2644
+ // `_castConditions()` reports cast errors on the query, but `sanitizeFilter`
2645
+ // throws for filters it refuses outright, like `$where`.
2646
+ return callback(err);
2645
2647
  }
2646
2648
 
2647
2649
  if (this.error()) {
@@ -2667,9 +2669,11 @@ Query.prototype._count = wrapThunk(function(callback) {
2667
2669
 
2668
2670
  Query.prototype._countDocuments = wrapThunk(function(callback) {
2669
2671
  try {
2670
- this.cast(this.model);
2672
+ this._castConditions();
2671
2673
  } catch (err) {
2672
- this.error(err);
2674
+ // `_castConditions()` reports cast errors on the query, but `sanitizeFilter`
2675
+ // throws for filters it refuses outright, like `$where`.
2676
+ return callback(err);
2673
2677
  }
2674
2678
 
2675
2679
  if (this.error()) {
@@ -5485,11 +5489,17 @@ Query.prototype.cursor = function cursor(opts) {
5485
5489
 
5486
5490
  const options = this._optionsForExec();
5487
5491
  try {
5488
- this.cast(this.model);
5492
+ this._castConditions();
5489
5493
  } catch (err) {
5494
+ // `_castConditions()` reports cast errors on the query, but `sanitizeFilter`
5495
+ // throws for filters it refuses outright, like `$where`.
5490
5496
  return (new QueryCursor(this, options))._markError(err);
5491
5497
  }
5492
5498
 
5499
+ if (this.error()) {
5500
+ return (new QueryCursor(this, options))._markError(this.error());
5501
+ }
5502
+
5493
5503
  return new QueryCursor(this, options);
5494
5504
  };
5495
5505
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mongoose",
3
3
  "description": "Mongoose MongoDB ODM",
4
- "version": "6.13.10",
4
+ "version": "6.13.11",
5
5
  "author": "Guillermo Rauch <guillermo@learnboost.com>",
6
6
  "keywords": [
7
7
  "mongodb",