Official Twitter of Mongoose, the most downloaded database framework on npm. Support our work: opencollective.com/mongoose 🙏 #nodejs #mongodb

Miami Beach, FL
Mongoose's `orFail()` function is great for avoiding repetitive `if (doc == null)` checks. Makes your query throw an error if no results Learn more 👉 mongoosejs.com/docs/api/quer… #NodeJS #MongoDB
2
4
8
Check out Mongoose maintainer @code_barbarian's eBook, "Mastering Mongoose"! masteringjs.io/ebooks/master…
Mongoose 6 removed support for autoReconnect option. In Mongoose 6, we retry every operation for `serverSelectionTimeoutMS` millis. Mongoose is never permanently disconnected after initial connection, unless you `disconnect()` #NodeJS #MongoDB #JavaScript
1
3
mongoosejs retweeted
Mongoose 6.5.3 released 🛠️ Handle maps when applying defaults to nested paths 🏎️ Remove extends Query in Schema.pre() and Schema.post() to speed up tsc Full changelog: github.com/Automattic/mongoo… #NodeJS #MongoDB #JavaScript
1
1
10
mongoosejs retweeted
Storing dates (no time component) in MongoDB? Consider storing dates as YYYYMMDD strings, rather than as Dates. Can still sort, $lte, $gte, etc., but better readability in UIs #NodeJS #MongoDB #JavaScript
1
4
10
Mongoose 6 was released August 24! Check out the migration guide: mongoosejs.com/docs/migratin…
1
Mongoose 6 was released August 24! Check out the migration guide: mongoosejs.com/docs/migratin…
1
Mongoose 6 was released August 24! Check out the migration guide: mongoosejs.com/docs/migratin…
Mongoose 6.5.1 released 🛠️ Set timestamps on child schema when child schema has timestamps: true but parent schema does not 🛠️ Handle insertMany() with timestamps and discriminators github.com/Automattic/mongoo… #NodeJS #MongoDB #JavaScript
1
2
5
Mongoose models have a `collection` property that stores the collection `name` This is handy for building aggregation pipelines with $lookup mongoosejs.com/docs/api/mode… #NodeJS #MongoDB #JavaScript
1
1
4
Mongoose plugins are neat for grouping related functionality. For example, instead of adding properties and virtuals separately to support reviews, just create a reviewPlugin that adds both. Similar to the Vue composition API Learn more mongoosejs.com/docs/plugins.… #NodeJS
1
6
mongoosejs retweeted
Mongoose 6.4.7 released: 🛠️ Use $locals for default virtual getter/setter rather than top-level doc 🛠️ Call subdocument getters if child schema has getters: true Full release notes: github.com/Automattic/mongoo… #NodeJS #MongoDB #JavaScript
1
1
6
mongoosejs retweeted
JavaScript's `split()` method is actually _very_ slow. Fast enough for end user facing apps, but too slow for libs to use repeatedly. This is why Mongoose pre-splits schema paths: github.com/Automattic/mongoo… #NodeJS #MongoDB #JavaScript
1
1
6
Mongoose 6 was released August 24! Check out the migration guide: mongoosejs.com/docs/migratin…