Mongoose 3.8 (stable) released

707 views
Skip to first unread message

Aaron Heckmann

unread,
Nov 1, 2013, 12:41:39 AM11/1/13
to mongoo...@googlegroups.com
The entire mongoose team is pleased to announce the latest stable release: 3.8.0. This release brings with it significant additions, dozens of bug fixes and some important deprecations and changes you should be aware of as detailed below.

The most significant additions/changes in 3.8 are


And the improvements don't stop there. To find out how to customize built-in validation error messages, disable collection name pluralization and more, read the full release notes available here: https://github.com/LearnBoost/mongoose/wiki/3.8-Release-Notes


Contributors
==========

We want to especially thank the following contributors who volunteered their time to help make this release possible. In no particular order:



Links and information
=================

Full release notes:  https://github.com/LearnBoost/mongoose/wiki/3.6-Release-Notes

Documentation http://mongoosejs.com/

Bug Reports http://github.com/learnboost/mongoose

StackOverflow http://stackoverflow.com/questions/tagged/mongoose

Google Groups https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm

Twitter https://twitter.com/mongoosejs

Plugins http://plugins.mongoosejs.com/

Production Examples http://mongoosejs.tumblr.com/

IRC #mongoosejs


Changelog
=========

 * updated; warn when using an unstable version
 * updated; error message returned in doc.save() #1595
 * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
 * updated; mquery to 0.3.2
 * updated; mocha to 1.12.0
 * updated; mpromise 0.3.0
 * updated; sliced 0.0.5

 * removed; mongoose.Error.DocumentError (never used)
 * removed; namedscope (undocumented and broken) #679 #642 #455 #379

 * changed; no longer officially supporting node 0.6.x
 * changed; query.within getter is now a method -> query.within()
 * changed; query.intersects getter is now a method -> query.intersects()

 * added; custom error msgs for built-in validators #747
 * added; discriminator support #1647 #1003 [j](https://github.com/j)
 * added; support disabled collection name pluralization #1350 #1707 [refack](https://github.com/refack)
 * added; support for GeoJSON to Query#near [ebensing](https://github.com/ebensing)
 * added; stand-alone base query support - query.toConstructor() [ebensing](https://github.com/ebensing)
 * added; promise support to geoSearch #1614 [ebensing](https://github.com/ebensing)
 * added; promise support for geoNear #1614 [ebensing](https://github.com/ebensing)
 * added; connection.useDb() #1124 [ebensing](https://github.com/ebensing)
 * added; promise support to model.mapReduce()
 * added; promise support to model.ensureIndexes()
 * added; promise support to model.populate()
 * added; benchmarks [ebensing](https://github.com/ebensing)
 * added; publicly exposed connection states #1585
 * added; $geoWithin support #1529 $1455 [ebensing](https://github.com/ebensing)
 * added; query method chain validation
 * added; model.update `overwrite` option
 * added; model.geoNear() support #1563 [ebensing](https://github.com/ebensing)
 * added; model.geoSearch() support #1560 [ebensing](https://github.com/ebensing)
 * added; MongooseBuffer#subtype()
 * added; model.create() now returns a promise #1340
 * added; support for `awaitdata` query option
 * added; pass the doc to doc.remove() callback #1419 [JoeWagner](https://github.com/JoeWagner)
 * added; aggregation query builder #1404 [njoyard](https://github.com/njoyard)

 * fixed; document.toObject when using `minimize` and `getters` options #1607 [JedWatson](https://github.com/JedWatson)
 * fixed; Mixed types can now be required #1722 [Reggino](https://github.com/Reggino)
 * fixed; do not pluralize model names not ending with letters #1703 [refack](https://github.com/refack)
 * fixed; repopulating modified populated paths #1697
 * fixed; doc.equals() when _id option is set to false #1687
 * fixed; strict mode warnings #1686
 * fixed; $near GeoJSON casting #1683
 * fixed; nearSphere GeoJSON query builder
 * fixed; population field selection w/ strings #1669
 * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
 * fixed; handle another versioning edge case #1520
 * fixed; excluding subdocument fields #1280 [ebensing](https://github.com/ebensing)
 * fixed; allow array properties to be set to null with findOneAndUpdate [aheuermann](https://github.com/aheuermann)
 * fixed; subdocuments now use own toJSON opts #1376 [ebensing](https://github.com/ebensing)
 * fixed; model#geoNear fulfills promise when results empty #1658 [ebensing](https://github.com/ebensing)
 * fixed; utils.merge no longer overrides props and methods #1655 [j](https://github.com/j)
 * fixed; subdocuments now use their own transform #1412 [ebensing](https://github.com/ebensing)
 * fixed; model.remove() removes only what is necessary #1649
 * fixed; update() now only runs with cb or explicit true #1644
 * fixed; casting ref docs on creation #1606 [ebensing](https://github.com/ebensing)
 * fixed; model.update "overwrite" option works as documented
 * fixed; query#remove() works as documented
 * fixed; "limit" correctly applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
 * fixed; issue with positional operator on ref docs #1572 [ebensing](https://github.com/ebensing)
 * fixed; benchmarks to actually output valid json

 * deprecated; promise#addBack (use promise#onResolve)
 * deprecated; promise#complete (use promise#fulfill)
 * deprecated; promise#addCallback (use promise#onFulFill)
 * deprecated; promise#addErrback (use promise#onReject)
 * deprecated; query.nearSphere() (use query.near)
 * deprecated; query.center() (use query.circle)
 * deprecated; query.centerSphere() (use query.circle)
 * deprecated; query#slaveOk (use query#read)

 * docs; custom validator messages
 * docs; 10gen -> MongoDB
 * docs; add Date method caveats #1598
 * docs; more validation details
 * docs; state which branch is stable/unstable
 * docs; mention that middleware does not run on Models
 * docs; promise.fulfill()
 * docs; fix readme spelling #1483 [yorchopolis](https://github.com/yorchopolis)
 * docs; fixed up the README and examples [ebensing](https://github.com/ebensing)

 * website; add "show code" for properties
 * website; move "show code" links down
 * website; update guide
 * website; add unstable docs
 * website; many improvements
 * website; fix copyright #1439
 * website; server.js -> static.js #1546 [nikmartin](https://github.com/nikmartin)

 * tests; refactor 1703
 * tests; add test generator
 * tests; validate formatMessage() throws
 * tests; add script for continuously running tests
 * tests; fixed versioning tests
 * tests; race conditions in tests
 * tests; added for nested and/or queries
 * tests; close some test connections
 * tests; validate db contents
 * tests; remove .only
 * tests; close some test connections
 * tests; validate db contents
 * tests; remove .only
 * tests; replace deprecated method names
 * tests; convert id to string
 * tests; fix sharding tests for MongoDB 2.4.5
 * tests; now 4-5 seconds faster
 * tests; fix race condition
 * make; suppress warning msg in test

 * benchmarks; updated for pull requests
 * examples; improved and expanded [ebensing](https://github.com/ebensing)

Felipe Lorenzo

unread,
Nov 13, 2013, 6:45:55 PM11/13/13
to mongoo...@googlegroups.com
Hi I've been having problem a couple of days now.  When I do test such as save and find it just hangs.

in charge.js

'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var ChargeSchema = new Schema({
name: {type: String, required: true, unique: true},
code: {type: String, required: true, unique: true},
isFixed: {type: Boolean, 'default': true}, // fixed rate?
amount: {type: Number, 'default': 0}, // rate/amount ex 100, 0.375
});

var Charge = mongoose.model('Charge', ChargeSchema);
exports.Charge = Charge;


in test.js

var mongoose = require('mongoose');
var angler = require('angler');
var Schema = mongoose.Schema;

mongoose.connect('mongodb://localhost/test');

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback() {

var charge = new angler.Charge({name: 'foo', code: 'blah'}); // this works

console.log(charge);

charge.save(function (err, charge) { // this does not
if (err) {
throw new Error(err);
}
console.log(charge);
process.exit(0);
});

});


When I put the schema and model compilation within test.js it works. Thanks for your help.

Павел Климашкин

unread,
Nov 16, 2013, 3:26:47 PM11/16/13
to mongoo...@googlegroups.com
Maybe because you creating model before you connected to db

четверг, 14 ноября 2013 г., 3:45:55 UTC+4 пользователь Felipe Lorenzo написал:
Reply all
Reply to author
Forward
0 new messages