Comparing version 1.1.4 to 1.1.5
1.1.5 / 2011-03-14 | ||
================== | ||
* Added support for `uri, db, fn` and `uri, fn` signatures for replica sets. | ||
* Improved/extended replica set tests. | ||
1.1.4 / 2011-03-09 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -162,2 +162,7 @@ | ||
if ('function' == typeof database) | ||
callback = database; | ||
else | ||
this.name = database; | ||
uris.forEach(function (uri) { | ||
@@ -179,2 +184,8 @@ var uri = url.parse(uri); | ||
if (!this.name) { | ||
if (callback) | ||
callback(new Error('No database name provided for replica set')); | ||
return; | ||
} | ||
// open connection | ||
@@ -181,0 +192,0 @@ this.doOpenSet(function (err) { |
@@ -284,3 +284,3 @@ | ||
exports.version = '1.1.4'; | ||
exports.version = '1.1.5'; | ||
@@ -287,0 +287,0 @@ /** |
{ | ||
"name": "mongoose" | ||
, "description": "Mongoose MongoDB ORM" | ||
, "version": "1.1.4" | ||
, "version": "1.1.5" | ||
, "author": "Guillermo Rauch <guillermo@learnboost.com>" | ||
@@ -6,0 +6,0 @@ , "keywords": ["mongodb", "mongoose", "orm", "data", "datastore", "nosql"] |
@@ -166,3 +166,3 @@ | ||
mongoose.connectSet(uri, function (err) { | ||
mong.connectSet(uri, function (err) { | ||
should.strictEqual(err, null); | ||
@@ -186,3 +186,3 @@ | ||
mongoose.connection.close(); | ||
mong.connection.close(); | ||
}); | ||
@@ -193,2 +193,34 @@ }); | ||
'test initializing a new Connection to a replica set': function () { | ||
var uri = process.env.MONGOOSE_SET_TEST_URI; | ||
if (!uri) return; | ||
var mong = new Mongoose(true); | ||
var conn = mong.createSetConnection(uri, function (err) { | ||
should.strictEqual(err, null); | ||
mong.model('ReplSetTwo', new mongoose.Schema({ | ||
test: String | ||
})); | ||
var Test = conn.model('ReplSetTwo') | ||
, test = new Test(); | ||
test.test = 'aa'; | ||
test.save(function (err) { | ||
should.strictEqual(err, null); | ||
Test.findById(test._id, function (err, doc) { | ||
should.strictEqual(err, null); | ||
doc.test.should.eql('aa'); | ||
conn.close(); | ||
}); | ||
}); | ||
}); | ||
}, | ||
'test public exports': function () { | ||
@@ -195,0 +227,0 @@ mongoose.version.should.be.a('string'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1881677
33687
85