[Haskell-cafe] Aeson + MongoDB, how to effortlessly store and retrieve json?

2013-02-18 Thread Alfredo Di Napoli
Good evening guys,

suppose I write a very simple parser using Aeson with these types and
ToJSON / FromJSON instances:

https://github.com/cakesolutions/the-pragmatic-haskeller/blob/master/01-json/Pragmatic/Types.hs
https://github.com/cakesolutions/the-pragmatic-haskeller/blob/master/01-json/Pragmatic/JSON/Parser.hs

My question is simple: is it possible to automagically store the haskell
data structure produced from the aeson encoding using

http://hackage.haskell.org/packages/archive/mongoDB/1.3.2/doc/html/Database-MongoDB-Query.html#g:7

Any tip/suggestion is welcome,

Thanks,
Alfredo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Aeson + MongoDB, how to effortlessly store and retrieve json?

2013-02-18 Thread Niklas Hambüchen
Not sure if this is helpful, but have a look at aesonbson:

https://github.com/nh2/aesonbson/blob/master/Data/AesonBson.hs

It can convert aeson to bson and the other way around, so you can easily
convert 'Object's to 'Document's.

Is that what you are looking for?

On 18/02/13 21:37, Alfredo Di Napoli wrote:
 My question is simple: is it possible to automagically store the
 haskell data structure produced from the aeson encoding using
 
 http://hackage.haskell.org/packages/archive/mongoDB/1.3.2/doc/html/Database-MongoDB-Query.html#g:7

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Aeson + MongoDB, how to effortlessly store and retrieve json?

2013-02-18 Thread Alfredo Di Napoli
Hi Niklas,

From a quick look it seems to be suitable for my task. I'll have a look ASAP 
and I'll keep you posted.

Many thanks!

Alfredo Di Napoli

On 19/feb/2013, at 00:32, Niklas Hambüchen m...@nh2.me wrote:

 Not sure if this is helpful, but have a look at aesonbson:
 
 https://github.com/nh2/aesonbson/blob/master/Data/AesonBson.hs
 
 It can convert aeson to bson and the other way around, so you can easily
 convert 'Object's to 'Document's.
 
 Is that what you are looking for?
 
 On 18/02/13 21:37, Alfredo Di Napoli wrote:
 My question is simple: is it possible to automagically store the
 haskell data structure produced from the aeson encoding using
 
 http://hackage.haskell.org/packages/archive/mongoDB/1.3.2/doc/html/Database-MongoDB-Query.html#g:7

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe