MongoMapField Query

127 views
Skip to first unread message

Bikash Patra

unread,
Jan 21, 2011, 4:43:07 AM1/21/11
to lif...@googlegroups.com
Stuck with a problem guys,need urgent help.

I want to store a map field to my mongo 


Say 

myfollowers[String , User]

where User is a case class .. something like

case class User(name:String, age:String,location:String)

So in my collection , I have

object myFollowers extends MongoMapField[Coll,User](this)

But when I make a save , it says , its not able to serialize the case class ..

Any clues

Tim Nelson

unread,
Jan 21, 2011, 7:20:54 AM1/21/11
to lif...@googlegroups.com
Hi Bikash,

MongoMapField only works with "standard" types. You would need something like MongoJsonObjectListField, except for Maps.

Tim

Bikash Patra

unread,
Jan 21, 2011, 10:14:39 AM1/21/11
to lif...@googlegroups.com
Thank you very much Tim, 

Infact after a long fight I too came to the conclusion, that it not supported.

Forgive my ignorance, but is there any specific reason for not having this feature?

Thanks again.

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Tim Nelson

unread,
Jan 21, 2011, 11:26:53 AM1/21/11
to lif...@googlegroups.com
No, just never got around to it.

You could easily add the functionality you want by overriding the asDBObject and setFromDBObject methods in your field. 

Tim
Reply all
Reply to author
Forward
0 new messages