Before if multiple threads instantiated their own ObjectIdGen
structure it would be possible to get duplicate objectid's
generated. By making sure there is a single inc counter, this is
avoided.
+ mapReduce is now the convience function that returns a cursor
+ runMapReduce can be called if you want the intermediate
result meta-data
+ mapReduceResults will take the result meta-data and open a
cursor on it
Turns out that order is sometimes important for BSON documents. Case
in point, "mapreduce" has to be the first field for the map/reduce
command.
To accomidate this we'll switch from using 'Map' to using a tuple-list
(eg '[(L8.ByteString, BsonValue)]'). Luckily most code that was using
toBsonDoc doesn't need to change.
While at it, 'Convertible' is not adding much value, and was causing
ambiguities making it less usefull (was requiring explicit type hints
more then it should have). Thus we are switching to our own conversion
typeclasses.
This was already merged (by cherry-pick) but aparently github doesn't
detect that, so this will hopefully properly show that these patches
have been pulled in.
Unfortunately it seem (emperically) that haddock only allows the pipe
character on the first line of document, not on every line. Or more
literally, it allows them, but treats them as part of the output to
display in the rendered document.
Fixing that, it also wasn't happy about not introducing the code block
as a new paragraph.
A '0' cursor-id means that no cursor was created, so there's nothing
to kill.
Also, findOne should never have a cursor opened for it, so no need
to even call finish.