Package

com.mongodb.casbah.query

dsl

Permalink

package dsl

Content Hierarchy Learn more about scaladoc diagrams
Visibility
  1. Public
  2. All

Type Members

  1. trait AddToSetOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $addToSet (addToSet) method as a bareword operator..

    Trait to provide the $addToSet (addToSet) method as a bareword operator..

    Targets an RValue of (String, Any)* to be converted to a DBObject

    Can also combined with the $each operator for adding many values:

    scala> $addToSet ("foo") $each (5, 10, 15, "20"))
    res1: com.mongodb.casbah.commons.Imports.DBObject = { "$addToSet" : { "foo" : { "$each" : [ 5 , 10 , 15 , "20"]

    }}}

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24addToSet

  2. trait AllOp extends QueryOperator

    Permalink

    Trait to provide the $all (Match ALL In Array) method on appropriate callers.

    Trait to provide the $all (Match ALL In Array) method on appropriate callers.

    Targets (takes a right-hand value of) Arrays of [Any] and variable argument lists of Any.

    Note that the magic of Scala DSLey-ness means that you can write a method such as:

    var x = "foo" $all (1, 2, 3, 5, 28)

    As a valid statement - (1...28) is taken as the argument list to $all and converted to an Array under the covers.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24all

  3. trait AndOp extends AnyRef

    Permalink

    Trait to provide the $and method as a bareword operator.

    Trait to provide the $and method as a bareword operator.

    $and ("Foo" -> "bar")

    Targets an RValue of (String, Any)* to be converted to a DBObject

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24and

  4. trait ArrayOps extends PushOp with PushAllOp with AddToSetOp with PopOp with PullOp with PullAllOp

    Permalink
  5. sealed abstract class BSONType[A] extends AnyRef

    Permalink
  6. trait BarewordQueryOperator extends AnyRef

    Permalink

    Base Operator class for Bareword Operators.

    Base Operator class for Bareword Operators.

    Bareword operators stand on their own - they lack the requirement for an LValue.

    Operator implementations (see SetOp for an example) should partially apply with just their operator name. The apply method's type parameter can be used to restrict the valid RValue values at will.

    Since

    1.0

    See also

    SetOp

  7. trait BitOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $bit (bit) update method as a bareword Operator

    Trait to provide the $bit (bit) update method as a bareword Operator

    Bit does a bitwise operation either AND or OR against a given field or set of fields with no left anchor.

    Targets an RValue of {field: {and|or: integer}}.

    Since

    2.1.1

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24bit

  8. trait CurrentDateOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $currentDate method as bareword operator

    Trait to provide the $currentDate method as bareword operator

    $currentDate ("field" -> "date") // to set current date to `field`

    or

    $currentDate ("field" -> "timestamp") // to set current timestamp to `field`

    Takes sequence of tuples (String, String)*, where second element must be either timestamp or date

    WORKS ONLY IN MONGODB 2.5.3+

    Since

    2.8.2

    See also

    http://docs.mongodb.org/manual/reference/operator/update/currentDate/

  9. trait DeprecatedGeoWithinOps extends QueryOperator

    Permalink

    Trait to provide the $within geospatial search method on appropriate callers

    Trait to provide the $within geospatial search method on appropriate callers

    Note that the args aren't TECHNICALLY latitude and longitude as they depend on: a) the order you specified your actual index in b) if you're using actual world maps or something else

    Deprecated in MongoDB 2.4 use $geoWithin instead

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Geospatial+Indexing

  10. trait ElemMatchOp extends QueryOperator

    Permalink

    Trait to provide the $elemMatch method on appropriate callers.

    Trait to provide the $elemMatch method on appropriate callers.

    Targets (takes a right-hand value of) a DBObject view context

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Dot+Notation+(Reaching+into+Objects)#DotNotation%28ReachingintoObjects%29-Matchingwith%24elemMatch

  11. trait EqualsOp extends QueryOperator

    Permalink

    Trait to provide an equals method on appropriate callers.

    Trait to provide an equals method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.

  12. trait ExistsOp extends QueryOperator

    Permalink

    Trait to provide the $exists (Exists) method on appropriate callers.

    Trait to provide the $exists (Exists) method on appropriate callers.

    Targets (takes a right-hand value of) Booleans.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7B%24exists%7D%7D

  13. trait FluidQueryBarewordOps extends SetOp with SetOnInsertOp with UnsetOp with IncOp with MaxOp with OrOp with AndOp with RenameOp with ArrayOps with NorOp with BitOp with WhereOp with SearchOp with CurrentDateOp

    Permalink

    Aggregation object for Bareword Operators.

    Aggregation object for Bareword Operators. Bareword operators stand on their own - they lack the requirement for an LValue. This mixes them in so they can be pulled down in a single import.

    Typically, you want to follow the model Implicits does, and mix this in if you want to use it but not import Implicits

    Since

    1.0

    See also

    com.mongodb.casbah.Implicits

  14. trait FluidQueryOperators extends EqualsOp with NotEqualsOp with LessThanOp with LessThanEqualOp with GreaterThanOp with GreaterThanEqualOp with InOp with NotInOp with ModuloOp with SizeOp with ExistsOp with AllOp with NotOp with SliceOp with TypeOp with RegexOp with ElemMatchOp with GeospatialOps with MetaProjectionOp

    Permalink

    Mixed trait which provides all possible operators.

    Mixed trait which provides all possible operators. See Implicits for examples of usage.

  15. case class GeoCoords[A, B](lat: A, lon: B)(implicit evidence$13: Imports.ValidNumericType[A], evidence$14: Manifest[A], evidence$15: Imports.ValidNumericType[B], evidence$16: Manifest[B]) extends Product with Serializable

    Permalink
  16. trait GeoIntersectsOp extends QueryOperator

    Permalink

    Trait to provide the $intersects geospatial search method on appropriate callers

    Trait to provide the $intersects geospatial search method on appropriate callers

    Since

    2.6.2

    See also

    http://www.mongodb.org/display/DOCS/Geospatial+Indexing

  17. trait GeoNearOp extends QueryOperator

    Permalink

    Trait to provide the $near geospatial search method on appropriate callers

    Trait to provide the $near geospatial search method on appropriate callers

    Note that the args aren't TECHNICALLY latitude and longitude as they depend on: a) the order you specified your actual index in b) if you're using actual world maps or something else

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Geospatial+Indexing

  18. trait GeoNearSphereOp extends QueryOperator

    Permalink

    Trait to provide the $nearSphere geospatial search method on appropriate callers

    Trait to provide the $nearSphere geospatial search method on appropriate callers

    Note that the args aren't TECHNICALLY latitude and longitude as they depend on: a) the order you specified your actual index in b) if you're using actual world maps or something else

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Geospatial+Indexing

  19. trait GeoWithinOps extends QueryOperator

    Permalink

    Trait to provide the nested $geoWithin geospatial search method on appropriate callers

    Trait to provide the nested $geoWithin geospatial search method on appropriate callers

    Note that the args aren't TECHNICALLY latitude and longitude as they depend on: a) the order you specified your actual index in b) if you're using actual world maps or something else

    Since

    2.6.2

    See also

    http://www.mongodb.org/display/DOCS/Geospatial+Indexing

  20. trait GeospatialOps extends GeoNearOp with GeoNearSphereOp with GeoWithinOps with GeoIntersectsOp with DeprecatedGeoWithinOps

    Permalink
  21. trait GreaterThanEqualOp extends QueryOperator

    Permalink

    Trait to provide the $gte (Greater Than Or Equal To) method on appropriate callers.

    Trait to provide the $gte (Greater Than Or Equal To) method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, JDK And Joda Dates, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.*

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%3C%2C%3C%3D%2C%3E%2C%3E%3D

  22. trait GreaterThanOp extends QueryOperator

    Permalink

    Trait to provide the $gt (Greater Than) method on appropriate callers.

    Trait to provide the $gt (Greater Than) method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, JDK And Joda Dates, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.*

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%3C%2C%3C%3D%2C%3E%2C%3E%3D

  23. trait InOp extends QueryOperator

    Permalink

    Trait to provide the $in (In Array) method on appropriate callers.

    Trait to provide the $in (In Array) method on appropriate callers.

    Targets (takes a right-hand value of) Arrays of [Any] and variable argument lists of Any.

    Note that the magic of Scala DSLey-ness means that you can write a method such as:

    var x = "foo" $in (1, 2, 3, 5, 28)

    As a valid statement - (1...28) is taken as the argument list to $in and converted to an Array under the covers.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24in

  24. trait IncOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $inc (inc) method as a bareword operator..

    Trait to provide the $inc (inc) method as a bareword operator..

    $inc ("foo" -> 5)

    Targets an RValue of (String, ValidNumericType)* to be converted to a DBObject

    Due to a quirk in the way I implemented type detection this fails if you mix ValidNumericType types. E.g. floats work, but not mixing floats and ints. This can be easily circumvented if you want 'ints' with floats by making your ints floats with .0:

    $inc ("foo" -> 5.0, "bar" -> 1.6)
    Since

    1.0

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24inc

  25. trait LessThanEqualOp extends QueryOperator

    Permalink

    Trait to provide the $lte (Less Than Or Equal To) method on appropriate callers.

    Trait to provide the $lte (Less Than Or Equal To) method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, JDK And Joda Dates, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.*

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%3C%2C%3C%3D%2C%3E%2C%3E%3D

  26. trait LessThanOp extends QueryOperator

    Permalink

    Trait to provide the $lt (Less Than) method on appropriate callers.

    Trait to provide the $lt (Less Than) method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, JDK And Joda Dates, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%3C%2C%3C%3D%2C%3E%2C%3E%3D

  27. trait MaxOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $max (max) method as a bareword operator..

    Trait to provide the $max (max) method as a bareword operator..

    $max ("foo" -> 10)

    Targets an RValue of (String, ValidNumericType)* to be converted to a DBObject

    Due to a quirk in the way I implemented type detection this fails if you mix ValidNumericType types. E.g. floats work, but not mixing floats and ints. This can be easily circumvented if you want 'ints' with floats by making your ints floats with .0:

    $max ("foo" -> 5.0, "bar" -> 1.6)
    Since

    2.8

    See also

    http://docs.mongodb.org/manual/reference/operator/update/max/

  28. trait MetaProjectionOp extends QueryOperator

    Permalink

    Trait providing a projection / sort helper for use with text search

    Trait providing a projection / sort helper for use with text search

    To be used alongside $text and a text index to project / sort via the text match score.

    > $text("hello") res0: { "$text" : { "$search" : "hello"}}

    > $text("hola") $language "spanish" res1: { "$text" : { "$search" : "hola" , "$language" : "spanish"}}

    Since

    2.7

    See also

    http://docs.mongodb.org/manual/core/index-text/

  29. trait ModuloOp extends QueryOperator

    Permalink

    Trait to provide the $mod (Modulo) method on appropriate callers.

    Trait to provide the $mod (Modulo) method on appropriate callers.

    Targets a left and right value where the formula is (field % left == right)

    Left and Right can be any ValidNumericType and of two differing types (e.g. one int, one float)

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24mod

  30. class NestedBarewordListOperator extends AnyRef

    Permalink
  31. trait NorOp extends AnyRef

    Permalink

    Trait to provide the $nor (nor) method as a bareword operator

    Trait to provide the $nor (nor) method as a bareword operator

    Nor is a combination of $not and $or with no left anchor

    Targets an RValue of (String, Array[Any])* to be converted to a DBObject

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24nor

  32. trait NotEqualsOp extends QueryOperator

    Permalink

    Trait to provide the $ne (Not Equal To) method on appropriate callers.

    Trait to provide the $ne (Not Equal To) method on appropriate callers.

    Targets (takes a right-hand value of) String, Numeric, Array, DBObject (and DBList), Iterable[_] and Tuple1->22.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24ne

  33. trait NotInOp extends QueryOperator

    Permalink

    Trait to provide the $nin (NOT In Array) method on appropriate callers.

    Trait to provide the $nin (NOT In Array) method on appropriate callers.

    Targets (takes a right-hand value of) Arrays of [Any] and variable argument lists of Any.

    Note that the magic of Scala DSLey-ness means that you can write a method such as:

    var x = "foo" $nin (1, 2, 3, 5, 28)

    As a valid statement - (1...28) is taken as the argument list to $nin and converted to an Array under the covers.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24nin

  34. trait NotOp extends QueryOperator

    Permalink

    Trait to provide the $not (Not) negation method on appropriate callers.

    Trait to provide the $not (Not) negation method on appropriate callers.

    Make sure your anchor it when you have multiple operators e.g.

    "foo".$not $mod(5, 10)

    Targets (takes a right-hand value of) DBObject or a Scala RegEx

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-Metaoperator%3A%24not

  35. trait OrOp extends AnyRef

    Permalink

    Trait to provide the $or method as a bareword operator.

    Trait to provide the $or method as a bareword operator.

    $or ("Foo" -> "bar")

    Targets an RValue of (String, Any)* to be converted to a DBObject

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or

  36. trait PopOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $pop (pop) method as a bareword operator..

    Trait to provide the $pop (pop) method as a bareword operator..

    If Field exists but is not an array an error will occurr.

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24pop

  37. trait PullAllOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $pullAll (pullAll) method as a bareword operator..

    Trait to provide the $pullAll (pullAll) method as a bareword operator..

    Targets an RValue of (String, Array[Any])* to be converted to a DBObject

    RValue MUST Be an array - otherwise use pull.

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24pullAll

  38. trait PullOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $pull (pull) method as a bareword operator..

    Trait to provide the $pull (pull) method as a bareword operator..

    Targets an RValue of (String, Any)* to be converted to a DBObject

    If Field exists but is not an array an error will occurr.

    Pull is special as defined in the docs and needs to allow operators on fields.

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24pull

  39. trait PushAllOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $pushAll (pushAll) method as a bareword operator..

    Trait to provide the $pushAll (pushAll) method as a bareword operator..

    Targets an RValue of (String, Array[Any])* to be converted to a DBObject

    RValue MUST Be an array - otherwise use push.

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24pushAll

  40. trait PushOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $push (push) method as a bareword operator.

    Trait to provide the $push (push) method as a bareword operator.

    Targets an RValue of (String, Any)* to be converted to a DBObject

    If Field exists but is not an array an error will occur

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24push

  41. trait QueryExpressionObject extends AnyRef

    Permalink
  42. trait QueryOperator extends ChainedOperator

    Permalink

    Base trait for QueryOperators, children are required to define a value for field, which is a String and refers to the left-hand of the Query (e.g.

    Base trait for QueryOperators, children are required to define a value for field, which is a String and refers to the left-hand of the Query (e.g. in Mongo: {"foo": {"$ne": "bar"}} "foo" is the field.

  43. trait RegexOp extends QueryOperator

    Permalink

    $regex operator to query by type.

    $regex operator to query by type.

    Takes a string for use in the $regex query

    "foo" $regex "\^bar$"

    Since

    2.6.2

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7B%24type%7D%7D

  44. trait RenameOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $rename (Rename field) as a bareword operator

    Trait to provide the $rename (Rename field) as a bareword operator

    Targets (takes a right-hand value of) a DBObject or a Tuple of (String, String)

    WORKS ONLY IN MONGODB 1.7.2+

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24rename

  45. trait SearchOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $text search method on appropriate callers

    Trait to provide the $text search method on appropriate callers

    > $text("description") res0: { "$text" : { "$search" : "description"}}

    > $text("description") $language "english" res1: { "$text" : { "$search" : "description" , "$language" : "english"}}

    Since

    2.7

    See also

    http://docs.mongodb.org/manual/core/index-text/

  46. trait SetOnInsertOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $setOnInsert (SetOnInsert) SetOnInsert method as a bareword operator.

    Trait to provide the $setOnInsert (SetOnInsert) SetOnInsert method as a bareword operator.

    $setOnInsert ("Foo" -> "bar")

    Targets an RValue of (String, Any)* to be converted to a DBObject

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24set

  47. trait SetOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $set (Set) Set method as a bareword operator.

    Trait to provide the $set (Set) Set method as a bareword operator.

    $set ("Foo" -> "bar")

    Targets an RValue of (String, Any)* to be converted to a DBObject

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24set

  48. trait SizeOp extends QueryOperator

    Permalink

    Trait to provide the $size (Size) method on appropriate callers.

    Trait to provide the $size (Size) method on appropriate callers.

    Test value must be an Int.

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24size

  49. trait SliceOp extends QueryOperator

    Permalink

    Trait to provide the $slice (Slice of Array) method on appropriate callers.

    Trait to provide the $slice (Slice of Array) method on appropriate callers.

    Targets (takes a right-hand value of) either an Int of slice indicator or a tuple of skip and limit.

    > "foo" $slice 5 res0: (String, com.mongodb.DBObject) = (foo,{ "$slice" : 5})

    > "foo" $slice (5, -1) res1: (String, com.mongodb.DBObject) = (foo,{ "$slice" : [ 5 , -1]})

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24sliceoperator

  50. trait TypeOp extends QueryOperator

    Permalink

    $type operator to query by type.

    $type operator to query by type.

    Can type a BSON.<enum value> or a Context Bounded check.

    Since

    2.0

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7B%24type%7D%7D

  51. trait UnsetOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $unset (UnSet) UnSet method as a bareword operator..

    Trait to provide the $unset (UnSet) UnSet method as a bareword operator..

    $unset ("foo")

    Targets an RValue of String*, where String are field names to be converted to a DBObject

    See also

    http://www.mongodb.org/display/DOCS/Updating#Updating-%24unset

  52. trait ValueTestFluidQueryOperators extends LessThanOp with LessThanEqualOp with GreaterThanOp with GreaterThanEqualOp with ModuloOp with SizeOp with AllOp with NotEqualsOp with TypeOp with RegexOp

    Permalink
  53. trait WhereOp extends BarewordQueryOperator

    Permalink

    Trait to provide the $where (Where) method on appropriate callers.

    Trait to provide the $where (Where) method on appropriate callers.

    Targets (takes a right-hand value of) JSFunction [which is currently just as string containing a javascript function]

    See also

    http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-JavascriptExpressionsand%7B%7B%24where%7D%7D

Value Members

  1. object BSONType

    Permalink
  2. object QueryExpressionObject

    Permalink

Ungrouped