Commit graph

133 commits

Author SHA1 Message Date
Scott R. Parish
8df947c704 8e035fded4 missed the Put side 2010-03-14 13:25:44 -05:00
Scott R. Parish
3956adab00 create global oigInc instance
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.
2010-03-13 21:44:42 -06:00
Scott R. Parish
e7c58bf4d7 BSON: use Integers to represent oid's, oid generation 2010-03-13 00:23:05 -06:00
Scott R. Parish
108532268b putI16 2010-03-12 23:03:56 -06:00
Scott R. Parish
ab3b73b9ac util: type putI8 like the other putI* functions 2010-03-12 23:03:37 -06:00
Scott R. Parish
8e035fded4 DataBinary's subtype ByteArray alone has an extra length
ByteArray has the extra length, aparently as a historical artifact,
requiring it to be special cased.

Thanks to Mathias Stearn for pointing this out!
2010-03-10 20:34:58 -06:00
Scott R. Parish
34599280f5 converter for Maybe type 2010-03-09 18:58:42 -06:00
Scott R. Parish
c1b8a21366 restoring array conversion using toBson/fromBson 2010-03-09 18:36:14 -06:00
Scott R. Parish
fb2f09171a change BsonDoc representation to maintain order
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.
2010-03-08 07:08:30 -06:00
Scott R. Parish
7587f435a2 support javascript code, rename to BsonJSCode to make it clearer what code 2010-03-08 07:04:04 -06:00
Scott R. Parish
cf9975468f rename BsonObject to BsonDoc to be more consistant with BSON definition 2010-03-06 12:28:57 -06:00
Scott R. Parish
92f37cc946 make changes suggested by hlint 2010-02-06 15:52:23 -06:00
Rick Richardson
58fbd2005f added whereClause, tidied code 2010-02-05 08:31:01 -05:00
Scott R. Parish
d606e47f33 make changes suggested by HLint 2010-01-24 20:58:49 -06:00
Scott R. Parish
f8652ed11a make BsonDoc a 'type' rather then 'newtype'
All the wraping/unwraping for the newtype was really cumbersome and
protection isn't really needed here.
2010-01-20 22:31:32 -06:00
Scott R. Parish
66ad002718 BsonValue convertible instances so fromBson can unwrap BsonObjects 2010-01-20 20:55:33 -06:00
Scott R. Parish
f173d9d0a7 convertible for BsonObject 2010-01-19 20:30:04 -06:00
Scott R. Parish
2c6905b45f BSON.empty 2010-01-18 18:32:44 -06:00
Scott R. Parish
30925bc90f add BsonDocOps class so document can be specified with String keys 2010-01-18 18:05:09 -06:00
Scott R. Parish
cef52ebf12 BSON.lookup 2010-01-18 15:04:14 -06:00
Scott R. Parish
f5f0ec2b8e add documentation for public functions/types 2010-01-18 13:24:14 -06:00
Scott R. Parish
949bece818 class for toBson/fromBson, instances for Maybe
For example, you can now use fromBson of Maybe BsonValue (eg the result of
a lookup) to convert to Maybe a.

You can also give a Maybe a to toBson and for Nothing it will produce
BsonNull and for Just a it will create the appropriate BsonValue for a.
2010-01-18 10:26:13 -06:00
Scott R. Parish
f60d984677 some initial Convertibles for converting from Bson 2010-01-18 09:57:25 -06:00
Scott R. Parish
67bf1245bb some initial (to BsonValue) Convertible instances and toBson 2010-01-17 23:08:14 -06:00
Scott R. Parish
4cfd4e7fa3 use what appears to be more standard naming, eg BsonValue instead of BSValue 2010-01-17 11:41:24 -06:00
Scott R. Parish
7f777c8fb4 compile with -Wall and -Werror, fix all ensuing breaks 2010-01-16 21:40:22 -06:00
Scott R. Parish
4c17f8e646 licenses (MIT) 2010-01-16 19:22:46 -06:00
Scott R. Parish
d1cccd075d create and use putNothing instead of using flush as a no-op 2010-01-12 19:59:52 -06:00
Scott R. Parish
b18d3d54b0 BSON: fix unexported data constructor 2010-01-10 21:23:54 -06:00
Scott R. Parish
2cea5777fb BSON: use Data.Map for BSONObjects 2010-01-10 21:23:54 -06:00
Scott R. Parish
61051bfc46 move the get/put* helpers to Util.hs so other modules can use them 2010-01-10 21:23:50 -06:00
Scott R. Parish
06391f5992 stuff to make into a package 2010-01-09 16:49:06 -06:00
Scott R. Parish
5c5ec38413 move BSON.hs to Database/MongoDB/BSON.hs 2010-01-09 16:36:59 -06:00