ayende/ravendb — pull request #80 by dlang (2012-01-15 07:18:39+00:00)
Title: 2 bugs related to map/reduces indexes found / 1 solved

The map/reduce index out of this blog post did never succeed: http://ayende.com/blog/4801/leaving-the-relational-mindset-ravendbs-trees

I've added a test to check that and found two bugs: one related to having an anonymous array in the map-function and the other to have let in the reduce function.

I could fix the first one doing a small change in ExpressionStringBuilder, but the other bug related is more complicated. When running the index it fails saying "could not find 'key' of object...". I'm pretty sure this has to do with anonymous properties being internal to the executing assembly. Because the indexes are executed within the dynamically compiled assembly, it cannot access the Key property on g, which is an anonymous object. I tried to play with compiler options and setting InternalsVisibleTo at runtime, but couldn't solve it...