mongoose 7.8.11 → 7.8.12
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/deno.lock +61 -0
- package/dist/browser.umd.js +1 -1
- package/lib/query.js +9 -11
- package/package.json +1 -1
package/lib/query.js
CHANGED
|
@@ -2625,11 +2625,7 @@ Query.prototype.findOne = function(conditions, projection, options) {
|
|
|
2625
2625
|
*/
|
|
2626
2626
|
|
|
2627
2627
|
Query.prototype._count = async function _count() {
|
|
2628
|
-
|
|
2629
|
-
this.cast(this.model);
|
|
2630
|
-
} catch (err) {
|
|
2631
|
-
this.error(err);
|
|
2632
|
-
}
|
|
2628
|
+
this._castConditions();
|
|
2633
2629
|
|
|
2634
2630
|
if (this.error()) {
|
|
2635
2631
|
throw this.error();
|
|
@@ -2655,11 +2651,7 @@ Query.prototype._count = async function _count() {
|
|
|
2655
2651
|
*/
|
|
2656
2652
|
|
|
2657
2653
|
Query.prototype._countDocuments = async function _countDocuments() {
|
|
2658
|
-
|
|
2659
|
-
this.cast(this.model);
|
|
2660
|
-
} catch (err) {
|
|
2661
|
-
this.error(err);
|
|
2662
|
-
}
|
|
2654
|
+
this._castConditions();
|
|
2663
2655
|
|
|
2664
2656
|
if (this.error()) {
|
|
2665
2657
|
throw this.error();
|
|
@@ -5057,11 +5049,17 @@ Query.prototype.cursor = function cursor(opts) {
|
|
|
5057
5049
|
}
|
|
5058
5050
|
|
|
5059
5051
|
try {
|
|
5060
|
-
this.
|
|
5052
|
+
this._castConditions();
|
|
5061
5053
|
} catch (err) {
|
|
5054
|
+
// `_castConditions()` reports cast errors on the query, but `sanitizeFilter`
|
|
5055
|
+
// throws for filters it refuses outright, like `$where`.
|
|
5062
5056
|
return (new QueryCursor(this))._markError(err);
|
|
5063
5057
|
}
|
|
5064
5058
|
|
|
5059
|
+
if (this.error()) {
|
|
5060
|
+
return (new QueryCursor(this))._markError(this.error());
|
|
5061
|
+
}
|
|
5062
|
+
|
|
5065
5063
|
return new QueryCursor(this);
|
|
5066
5064
|
};
|
|
5067
5065
|
|