The col:count() and the authenticate functions use the function attachpairs_start to construct the message to the MongoDb server. This works in our old instance of MongoDb 2.4 but fails in MongoDb 3.x and MongoDb 4.0. Analysis showed that the modified pairs function was duplicating entries e.g.
This apparently now is prohibited in MongoDb. The col:count() method (for example) silently fails due to MongoDb error message about duplicate BSON field names. (Authenticate also fails with a similar message).
The corrections attached still perform the original intent (as best as I can figure out) of moving the named field to the start of the list, but skip it when encountered again. We were able to successfully call col:count() once this patch was applied.
The col:count() and the authenticate functions use the function
attachpairs_start
to construct the message to the MongoDb server. This works in our old instance of MongoDb 2.4 but fails in MongoDb 3.x and MongoDb 4.0. Analysis showed that the modifiedpairs
function was duplicating entries e.g.{ "count": "collectionname", "count": "collectionname", "query":"something" }
This apparently now is prohibited in MongoDb. The col:count() method (for example) silently fails due to MongoDb error message about duplicate BSON field names. (Authenticate also fails with a similar message).
The corrections attached still perform the original intent (as best as I can figure out) of moving the named field to the start of the list, but skip it when encountered again. We were able to successfully call col:count() once this patch was applied.