You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Causes Client Error: bad object in message: bson length doesn't match what we found
The root of the problem appears to be that utils.clone and utils.cloneObject do not properly handle the mongodb.Long type (and likely Timestamp and possibly other non-native BSON types).
This could be fixed by adding another obj.constructor special case to clone for these types. Alternatively, the reason that the clone doesn't currently work is that functions are cloned by converting their source to a number and calling the Function constructor, which doesn't work for the functions on the Long prototype. In either case, it shouldn't be too bad to fix.
Cheers,
Kevin
The text was updated successfully, but these errors were encountered:
Using the MongoDB
Long
/NumberLong
type in queries can cause a few different errors in mquery. For example:Causes
Client Error: bad object in message: invalid bson type
whileCauses
Client Error: bad object in message: bson length doesn't match what we found
The root of the problem appears to be that
utils.clone
andutils.cloneObject
do not properly handle themongodb.Long
type (and likelyTimestamp
and possibly other non-native BSON types).This could be fixed by adding another
obj.constructor
special case toclone
for these types. Alternatively, the reason that the clone doesn't currently work is that functions are cloned by converting their source to a number and calling theFunction
constructor, which doesn't work for the functions on theLong
prototype. In either case, it shouldn't be too bad to fix.Cheers,
Kevin
The text was updated successfully, but these errors were encountered: