mongodb/mongo — pull request #212 by victorkab (2012-04-13 20:33:43+00:00)
Title: Pipeline bindata fix

Hi,

This is an attempt to fix for this Ticket: https://jira.mongodb.org/browse/SERVER-4608

When a Bindata passes through the pipeline it's actively refused by mongoDB. This assumption is made because the BinData may have an arbitrary size. However since Bindata have subtype we can distinguish arbitrary sized binary data from *fixed* sized Bindata.

In my fix I do not attempt to treat all cases of BinData but only the type btdUUID, newUUID and MD5Type, they all share the property to be only 16 bytes. I handled the case where the user try to compare different BinData and the case where BinData is not btdUUID or newUUID or MD5Type (they are rejected from the pipeline).
I compare UUID and MD5Type using lexicographical order and the hash_combine use boost's hash_combine for BinData.

**ISSUE**: The result of a pipeline is not displayed correctled and UUID are just marked with true
Example :
{u'ok': 1.0, u'result': [{u'TeamNumber_sum': 2449, u'_id': True}, {u'TeamNumber_sum': 2400, u'_id': True}]}
_id should contain the UUID, but it's just a true, note that here I used a $group on two UUID and $sum the TeamNumber. The set is composed of 1000 documents.

Thanks,
Victor Kabdebon