mongodb/mongo — pull request #568 by dstorch (2013-12-05 21:00:37+00:00)
Title: SERVER-10026 cleanup positional projection operator validation

1) Refactors the validation of the positional projection operator so that it all happens in one place.

2) Adds validation which prevents the positional operator from appearing twice in a path, e.g. the projection "a.$.b.$". There is comparable validation for the update version of the positional operator, so we should do it here too.

3) Cleaner code for ensuring that the positional operator matches the query document. The cleaned up version also traverses logical match expression nodes, which we didn't properly do before.