-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.2
-
Component/s: MongoDB 3.2
-
Labels:
-
Empty show more show less
The same code exactly works on mongodb version 2.1.8.
Using the following 'open' API:
http://mongodb.github.io/node-mongodb-native/2.2/api/GridStore.html#open
running the following code:
var fileId = new ObjectID();; gridStore = new BackendConnection.gridStore(db, fileId, 'w'); gridStore.open(function (err, gridStore) { var file = gridStore; });
throws the following exeption to strerr (not getting inside the callback function):
/usr/bin/node --debug-brk=53884 --expose-debug-as=v8debug /home/tom/IntSights/dashboard/src/servers/worker/worker.js Debugger listening on port 53884 /home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/utils.js:98 process.nextTick(function() { throw err; }); ^ TypeError: Argument must be a string at TypeError (native) at Buffer.write (buffer.js:575:21) at serializeObjectId (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/bson/lib/bson/parser/serializer.js:242:10) at serializeInto (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/bson/lib/bson/parser/serializer.js:699:17) at serializeObject (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/bson/lib/bson/parser/serializer.js:280:18) at serializeInto (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/bson/lib/bson/parser/serializer.js:705:17) at serialize (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/bson/lib/bson/bson.js:47:27) at Query.toBin (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/commands.js:146:25) at Cursor._find (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:263:30) at nextFunction (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:576:10) at Cursor.next [as _next] (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:693:3) at nextObject (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/cursor.js:658:8) at Cursor.next (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/cursor.js:262:12) at findOne (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/collection.js:1355:10) at Collection.findOne (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/collection.js:1341:44) at _open (/home/tom/IntSights/dashboard/src/node_modules/mongodb/lib/gridfs/grid_store.js:956:16) at /home/tom/IntSights/dashboard/src/node_modules/mongodb/lib/gridfs/grid_store.js:228:9 at handleCallback (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/utils.js:96:12) at /home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/db.js:1088:49 at handleCallback (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/utils.js:96:12) at /home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/db.js:1629:5 at handleCallback (/home/tom/IntSights/dashboard/src/node_modules/mongoose/node_modules/mongodb/lib/utils.js:96:12) Process finished with exit code 1