Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Error: BasicDBList cannot be cast to List
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
stephanos  
View profile  
 More options Jun 12 2012, 7:19 am
From: stephanos <stephan.beh...@gmail.com>
Date: Tue, 12 Jun 2012 04:19:56 -0700 (PDT)
Local: Tues, Jun 12 2012 7:19 am
Subject: Error: BasicDBList cannot be cast to List

I'm having a little trouble with subselects and can't figure out why. I
have a collection of apps, each document has a field 'team' where 'team
members' are listed.

To find a team member via his user id I wrote this:

def findTeamMember(appId: Int, userId: ObjectId): Option[TM] =
    for {
        result <- AppCol.where(_._id eqs appId)

.scan(_.team.subfield(_.members.subfield(_.user.subfield(_.id))) in
List(userId))
            .select(_.team.subselect(_.members)).get()
        members <- result.headOption
        member <- members.headOption
    } yield member

But I keep getting this error:

Caused by: java.lang.ClassCastException: com.mongodb.BasicDBList cannot be
cast to scala.collection.immutable.List
at
com.mycompany.TeamReader$$anonfun$findTeamMember$9$$anonfun$apply$14.apply( TeamReaderComp.scala:62)
at scala.Option.flatMap(Option.scala:146)
at
com.mycompany.TeamReader$$anonfun$findTeamMember$9.apply(TeamReaderComp.sca la:62)
at
com.mycompany.TeamReader$$anonfun$findTeamMember$9.apply(TeamReaderComp.sca la:58)
at scala.Option.flatMap(Option.scala:146)
at com.mycompany.TeamReader.findTeamMember(TeamReaderComp.scala:58)

*What could I do about it?*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
stephanos  
View profile  
 More options Jun 12 2012, 9:50 am
From: stephanos <stephan.beh...@gmail.com>
Date: Tue, 12 Jun 2012 06:50:47 -0700 (PDT)
Local: Tues, Jun 12 2012 9:50 am
Subject: Re: Error: BasicDBList cannot be cast to List

Hm, when I use

  AppCol
    .where(_._id eqs sourceId)
    .scan(_.team.subfield(_.members.subfield(_.user.subfield(_.id))) in
List(userId))
    .select(_.team.subfield(_.members))
    .get().headOption.getOrElse(Empty).getOrElse(List()).headOption

it says

  java.lang.ClassCastException: com.mongodb.BasicDBList cannot be cast to
scala.collection.TraversableLike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Liszka  
View profile  
 More options Jun 13 2012, 12:09 pm
From: Jason Liszka <jlis...@foursquare.com>
Date: Wed, 13 Jun 2012 12:09:07 -0400
Local: Wed, Jun 13 2012 12:09 pm
Subject: Re: Error: BasicDBList cannot be cast to List

Hm, not sure without looking at how your models are declared, in particular
the types of all the fields involved. Could you send that over?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
stephanos  
View profile  
 More options Jun 14 2012, 7:46 am
From: stephanos <stephan.beh...@gmail.com>
Date: Thu, 14 Jun 2012 04:46:41 -0700 (PDT)
Local: Thurs, Jun 14 2012 7:46 am
Subject: Re: Error: BasicDBList cannot be cast to List

I will send you the relevant code in a private mail.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »