rejectedsoftware/vibe.d — pull request #172 by Dicebot (2013-01-27 22:26:21+00:00)
Title: Added range for MongoCursor

One of enhancement I have long wanted - working with MongoCursor with InputRange interface. Allows for more functional way to process database data into final output with all std.algorithm & friends help.

Motivating example from tests:

```
coll.insert(["key1" : "value1"]);
coll.insert(["key1" : "value2"]);
coll.insert(["key1" : "value2"]);
auto data1 = coll.find(["key1" : "value1"]);
auto data2 = coll.find(["key1" : "value2"]);

import std.range, std.algorithm;
auto converted = map!
(a => a[0].key1.get!string() ~ a[1].key1.get!string()(
zip(data1.range, data2.range)
);
assert(!converted.empty);
assert(converted.front == "value1value2");
```