Skip to content

Latest commit

 

History

History
45 lines (26 loc) · 969 Bytes

File metadata and controls

45 lines (26 loc) · 969 Bytes

Migrating to v1.0.0

Breaking Changes

Minimum mongoose version is now 8.0.0

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.

Dropped Node.js < 18

Node.js 18 is the minimum supported version.

What's New

Rewritten in TypeScript

The codebase has been rewritten in TypeScript.

Dual ESM and CommonJS support

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.

Supports mongoose 8.x and 9.x

Tested against both mongoose 8.x and 9.x in CI.