Re: [MongoMapper] JSON datatype?

47 views
Skip to first unread message

Kevin Lawver

unread,
Aug 10, 2012, 7:01:23 AM8/10/12
to mongo...@googlegroups.com
Hash works for cases like that. 

Kevin Lawver
Sent from my phone. Please excuse any spelling airs. 


On Aug 10, 2012, at 6:33, macarthy <justin.m...@gmail.com> wrote:


I have a model where I know some field up front, and also has one field which will be a bunch of Json. I like to store this in a the documents so it is available to query. Is there a JSON type or similar?

In the mongo gem I'd use the insert method. What is the method in mongoMapper ?

Thanks  

--
You received this message because you are subscribed to the Google
Groups "MongoMapper" group.
For more options, visit this group at
http://groups.google.com/group/mongomapper?hl=en?hl=en

Justin Dossey

unread,
Aug 10, 2012, 12:43:27 PM8/10/12
to mongo...@googlegroups.com
I have a case where I have a document which will always be returned as JSON, and the encoding is expensive; in that case, I memoize it as a string attribute "this_as_json" and return that.  Of course, it must be updated when the other attributes are updated.

Justin Dossey

macarthy

unread,
Aug 15, 2012, 11:38:26 PM8/15/12
to mongo...@googlegroups.com
Thanks all, Hash work for me 
Reply all
Reply to author
Forward
0 new messages