The peer dependency changed from mongoose >= 5.x to mongoose >= 8.0.0. If you are on mongoose 5, 6, or 7, you must upgrade mongoose before upgrading this plugin.
Node.js 18 is the minimum supported version.
The codebase has been rewritten in TypeScript.
The package now ships both ESM and CommonJS builds.
ESM:
import mongoose from 'mongoose';
import castAggregation from 'mongoose-cast-aggregation';
mongoose.plugin(castAggregation);CommonJS:
const mongoose = require('mongoose');
const castAggregation = require('mongoose-cast-aggregation');
mongoose.plugin(castAggregation);The require() call returns the plugin function directly, same as v0.x.
Tested against both mongoose 8.x and 9.x in CI.