mongoose-moment
JSON →Mongoose schema type for storing Moment.js dates as millisecond timestamps in MongoDB. Current version 0.1.3, last updated in 2014. This package registers a custom schema type 'Moment' that automatically converts Moment instances to UNIX timestamps (ms) on save and hydrates them back to Moment objects on read. It requires mongoose >=3.5.7 and moment 2.x as peer dependencies. Key differentiator: seamless integration with Moment.js for date manipulation in Mongoose schemas. Note: query values must be manually converted to timestamps using .valueOf() as Mongoose does not cast query parameters by default. The package is unchanged since 2014 and may not work with modern Mongoose versions.
Resources
packagemongoose-moment ↗