Skip to content

Commit

Permalink
fix insertedId error and change benchmark output
Browse files Browse the repository at this point in the history
  • Loading branch information
billouboq committed Dec 26, 2016
1 parent 7006b5e commit 4b47b5d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchjs/casting.js
Expand Up @@ -136,6 +136,6 @@ suite.add('Casting - Embedded Docs - 0 Docs', {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
}).run({async: true});
4 changes: 2 additions & 2 deletions benchmarks/benchjs/delete.js
Expand Up @@ -61,7 +61,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
nData.likes = data.likes;
nData.address = data.address;
user.insert(nData, function(err, res) {
dIds.push(res[0]._id);
dIds.push(res.insertedIds[0]);
--count || next();
});
}
Expand Down Expand Up @@ -120,7 +120,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
});
function next() {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchjs/insert.js
Expand Up @@ -169,7 +169,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
}).run({async: true});
});
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchjs/multiop.js
Expand Up @@ -126,7 +126,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
if (err) {
throw err;
}
dIds.push(res[0]._id);
dIds.push(res.insertedIds[0]);
--count || next();
});
BlogPost.create(blogData, function(err, bp) {
Expand All @@ -142,7 +142,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
if (err) {
throw err;
}
bdIds.push(res[0]._id);
bdIds.push(res.insertedIds[0]);
--count || next();
});
}
Expand Down Expand Up @@ -447,7 +447,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
});
function next() {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchjs/population.js
Expand Up @@ -387,7 +387,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench-pop', function(err) {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
});
function next() {
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchjs/update.js
Expand Up @@ -115,7 +115,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
});
var nData = utils.clone(data);
user.insert(nData, function(err, res) {
dIds.push(res[0]._id);
dIds.push(res.insertedIds[0]);
--count || next();
});
BlogPost.create(blogData, function(err, bp) {
Expand All @@ -132,7 +132,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
if (err) {
throw err;
}
bdIds.push(res[0]._id);
bdIds.push(res.insertedIds[0]);
--count || next();
});
}
Expand Down Expand Up @@ -329,7 +329,7 @@ mongoose.connect('mongodb://localhost/mongoose-bench', function(err) {
out.ops = item.hz;
outObj[item.name.replace(/\s/g, '')] = out;
});
console.log(JSON.stringify(outObj));
console.dir(outObj, {depth: null, colors: true});
}
});
function next() {
Expand Down

0 comments on commit 4b47b5d

Please sign in to comment.