Groups
Groups
Sign in
Groups
Groups
scala-salat
Conversations
About
Send feedback
Help
Only get name and lastname?
9 views
Skip to first unread message
Michael Larsson
unread,
Apr 25, 2013, 3:47:16 AM
4/25/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala...@googlegroups.com
Hi.
How will I only get the firstname and lastname from a collection that contains address, phone and so on?
Ex:
EventDAO(language).find(MongoDBObject("id"-> new ObjectId(id))).toList
/Thanks
Eduardo Obando
unread,
Apr 30, 2013, 12:00:57 PM
4/30/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala...@googlegroups.com
EventDAO(language).find(MongoDBObject("id"-> new ObjectId(id))
, MongoDBObject("firstname" -> 1, "lastname" -> 1)
).toList
But you need to make sure that the address, phone and others has a default, otherwise it would throw an exception.
case class Event(firstname: String, lastname: String, address: String
= ""
, phone: String
= ""
)
Reply all
Reply to author
Forward
0 new messages