Search code examples
scalacasbah

Why does $eq behave differently to $ne in casbah?


Why does $eq behave differently to $ne in casbah?

import com.mongodb.casbah.Imports._

object O{  
   val x = "user" $ne "bwmcadams"  // Compile fine
   val y = "user" $eq "bwmcadams"  // fails to compile: value = is not a member of string
}

Built with:

    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>casbah-core_2.10</artifactId>
        <version>2.6.0</version>
    </dependency>

Solution

  • The $eq operator was added in a later version of Casbah. Try changing your Casbah version to 2.6.3.