-
Type: Bug
-
Resolution: Done
-
Priority: Blocker - P1
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Empty show more show less
Code:
var mongodb = require('mongodb'); mongodb.MongoClient.connect('mongodb://localhost:27017', function(error, db) { db.dropDatabase(function() { db.collection('test').insert({ name: 'Val', result: [{ x: 1 }] }, function() { db.collection('test').findOne({ name: 'Val' }, function(error, doc) { console.log(JSON.stringify(doc)); }); }); }); });
Output:
{"x":1}
As a result of the following code in mongodb-core: https://github.com/christkv/mongodb-core/blob/d57b52f8efffaa6c16e598a119fe65737a00c7c6/lib/cursor.js#L193-196