diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-03-02 00:06:07 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-03-02 00:06:07 -0500 |
commit | 9959628dd561c7c181469cb193a286481e478aad (patch) | |
tree | ec46845bad1ba8649c3ffca82102e68b541fb6a0 | |
parent | 4308f8e6117cc839c553709aafb1122e6ef30190 (diff) | |
parent | 677c053850393f8ee670e4bf68cce41f49305cde (diff) | |
download | mongo-9959628dd561c7c181469cb193a286481e478aad.tar.gz |
Merge branch 'master' of github.com:mongodb/mongo
-rw-r--r-- | jstests/insert1.js | 8 | ||||
-rw-r--r-- | shell/collection.js | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/jstests/insert1.js b/jstests/insert1.js index 834fed56a1e..76edca1d593 100644 --- a/jstests/insert1.js +++ b/jstests/insert1.js @@ -3,7 +3,7 @@ t.drop(); o = {a:1}; t.insert(o); -id = t.lastID +id = t._lastID assert.eq(o, {a:1}, "input unchanged 1"); assert.eq(typeof(id), "object", "1"); assert.eq(id.constructor, ObjectId, "1"); @@ -13,7 +13,7 @@ assert.eq(t.findOne({a:1})._id, id , "find by val 1"); o = {a:2, _id:new ObjectId()}; id1 = o._id t.insert(o); -id2 = t.lastID +id2 = t._lastID assert.eq(id1, id2, "ids match 2"); assert.eq(o, {a:2, _id:id1}, "input unchanged 2"); assert.eq(typeof(id2), "object", "2"); @@ -24,7 +24,7 @@ assert.eq(t.findOne({a:2})._id, id1 , "find by val 2"); o = {a:3, _id:"asdf"}; id1 = o._id t.insert(o); -id2 = t.lastID +id2 = t._lastID assert.eq(id1, id2, "ids match 3"); assert.eq(o, {a:3, _id:id1}, "input unchanged 3"); assert.eq(typeof(id2), "string", "3"); @@ -34,7 +34,7 @@ assert.eq(t.findOne({a:3})._id, id1 , "find by val 3"); o = {a:4, _id:null}; id1 = o._id t.insert(o); -id2 = t.lastID +id2 = t._lastID assert.eq(id1, id2, "ids match 4"); assert.eq(o, {a:4, _id:id1}, "input unchanged 4"); assert.eq(t.findOne({_id:id1}).a, 4, "find by id 4"); diff --git a/shell/collection.js b/shell/collection.js index ae13ca5c150..edb07ae44dd 100644 --- a/shell/collection.js +++ b/shell/collection.js @@ -163,7 +163,7 @@ DBCollection.prototype.insert = function( obj , _allow_dot ){ } } this._mongo.insert( this._fullName , obj ); - this.lastID = obj._id; + this._lastID = obj._id; } DBCollection.prototype.remove = function( t ){ |