Permalink
Browse files

fix insertedId error and change benchmark output

  • Loading branch information...
1 parent 7006b5e commit 4b47b5d3abf31247eab605512b154964b37bc6ca @billouboq billouboq committed Dec 26, 2016
@@ -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});
@@ -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();
});
}
@@ -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() {
@@ -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});
});
@@ -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) {
@@ -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();
});
}
@@ -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() {
@@ -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() {
@@ -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) {
@@ -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();
});
}
@@ -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() {

0 comments on commit 4b47b5d

Please sign in to comment.