package dsl
- Alphabetic
- Public
- All
Type Members
-
trait
AddToSetOp
extends BarewordQueryOperator
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
-
trait
AllOp
extends QueryOperator
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
-
trait
AndOp
extends AnyRef
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
- trait ArrayOps extends PushOp with PushAllOp with AddToSetOp with PopOp with PullOp with PullAllOp
- sealed abstract class BSONType [A] extends AnyRef
-
trait
BarewordQueryOperator
extends AnyRef
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
-
trait
BitOp
extends BarewordQueryOperator
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
-
trait
CurrentDateOp
extends BarewordQueryOperator
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 eithertimestamp
ordate
WORKS ONLY IN MONGODB 2.5.3+
- Since
2.8.2
- See also
http://docs.mongodb.org/manual/reference/operator/update/currentDate/
-
trait
DeprecatedGeoWithinOps
extends QueryOperator
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
-
trait
ElemMatchOp
extends QueryOperator
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
-
trait
EqualsOp
extends QueryOperator
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.
-
trait
ExistsOp
extends QueryOperator
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
-
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
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
-
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
Mixed trait which provides all possible operators.
Mixed trait which provides all possible operators. See Implicits for examples of usage.
- 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
-
trait
GeoIntersectsOp
extends QueryOperator
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
-
trait
GeoNearOp
extends QueryOperator
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
-
trait
GeoNearSphereOp
extends QueryOperator
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
-
trait
GeoWithinOps
extends QueryOperator
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
- trait GeospatialOps extends GeoNearOp with GeoNearSphereOp with GeoWithinOps with GeoIntersectsOp with DeprecatedGeoWithinOps
-
trait
GreaterThanEqualOp
extends QueryOperator
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
-
trait
GreaterThanOp
extends QueryOperator
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
-
trait
InOp
extends QueryOperator
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
-
trait
IncOp
extends BarewordQueryOperator
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
-
trait
LessThanEqualOp
extends QueryOperator
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
-
trait
LessThanOp
extends QueryOperator
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
-
trait
MaxOp
extends BarewordQueryOperator
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/
-
trait
MetaProjectionOp
extends QueryOperator
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/
-
trait
ModuloOp
extends QueryOperator
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
- class NestedBarewordListOperator extends AnyRef
-
trait
NorOp
extends AnyRef
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
-
trait
NotEqualsOp
extends QueryOperator
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
-
trait
NotInOp
extends QueryOperator
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
-
trait
NotOp
extends QueryOperator
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
-
trait
OrOp
extends AnyRef
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
-
trait
PopOp
extends BarewordQueryOperator
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
-
trait
PullAllOp
extends BarewordQueryOperator
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
-
trait
PullOp
extends BarewordQueryOperator
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
-
trait
PushAllOp
extends BarewordQueryOperator
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
-
trait
PushOp
extends BarewordQueryOperator
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
- trait QueryExpressionObject extends AnyRef
-
trait
QueryOperator
extends ChainedOperator
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. -
trait
RegexOp
extends QueryOperator
$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
-
trait
RenameOp
extends BarewordQueryOperator
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
-
trait
SearchOp
extends BarewordQueryOperator
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/
-
trait
SetOnInsertOp
extends BarewordQueryOperator
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
-
trait
SetOp
extends BarewordQueryOperator
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
-
trait
SizeOp
extends QueryOperator
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
-
trait
SliceOp
extends QueryOperator
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
-
trait
TypeOp
extends QueryOperator
$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
-
trait
UnsetOp
extends BarewordQueryOperator
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
- trait ValueTestFluidQueryOperators extends LessThanOp with LessThanEqualOp with GreaterThanOp with GreaterThanEqualOp with ModuloOp with SizeOp with AllOp with NotEqualsOp with TypeOp with RegexOp
-
trait
WhereOp
extends BarewordQueryOperator
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
- object BSONType
- object QueryExpressionObject