Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2092

bson-ext error - TypeError: First argument passed in must be an array of types

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.3
    • Affects Version/s: 3.2.7
    • Component/s: BSON, EJSON, Native
    • Environment:
      Ubuntu

      I have mongodb installed (^3.2.7) and I then install bson-ext to try to have better performance. But then, I have the the following error:

       

      TypeError: First argument passed in must be an array of types
            at new Topology (node_modules/mongodb-core/lib/sdam/topology.js:134:29)
            at new NativeTopology (node_modules/mongodb/lib/topologies/native_topology.js:36:5)
            at createTopology (node_modules/mongodb/lib/operations/mongo_client_ops.js:400:16)
            ...
      

       Il semble que ça vienne de cette ligne : dans /mongodb-core/blob/master/lib/sdam/topology.js#L134 :

      // bson: options.bson || new BSON(),
      

       alors que la doc de bson-ext demande les types

      // Create a bson parser instance, passing in all the types 
      // This is needed so the C++ parser has references to the classes and can 
      // use them to serialize and deserialize the types. 
      var bson = new BSON([
          BSON.Binary, 
          BSON.Code, 
          BSON.DBRef, 
          ...
      ]);
      

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            alexandre.djerbetian@gmail.com Alexandre Djerbetian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: