implicit final class DSLExtensions extends AnyVal
Mongo DSL Extensions
- Alphabetic
- By Inheritance
- DSLExtensions
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
DSLExtensions(attribute: String)
- attribute
the given JSON attribute
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
$addToSet(value: ⇒ Any): (String, Dictionary[Any])
Adds elements to an array only if they do not already exist in the set.
Adds elements to an array only if they do not already exist in the set.
- Annotations
- @inline()
{ $addToSet: {letters: [ "c", "d" ] } }
Example: -
def
$all(array: ⇒ Array[_]): (String, Dictionary[Any])
The $all is equivalent to an $and operation of the specified values; i.e.
The $all is equivalent to an $and operation of the specified values; i.e. the following statement:
- Annotations
- @inline()
{ tags: { $all: [ "ssl" , "security" ] } }
Example: -
def
$all(values: Any*): (String, Dictionary[Any])
The $all is equivalent to an $and operation of the specified values; i.e.
The $all is equivalent to an $and operation of the specified values; i.e. the following statement:
- Annotations
- @inline()
{ tags: { $all: [ "ssl" , "security" ] } }
Example: -
def
$elemMatch(value: (String, Any)*): (String, Dictionary[Any])
Projects the first element in an array that matches the specified $elemMatch condition.
Projects the first element in an array that matches the specified $elemMatch condition.
- Annotations
- @inline()
{ students: { $elemMatch: { school: 102 } } }
Example: -
def
$elemMatch(value: ⇒ Any): (String, Dictionary[Any])
Projects the first element in an array that matches the specified $elemMatch condition.
Projects the first element in an array that matches the specified $elemMatch condition.
- Annotations
- @inline()
{ students: { $elemMatch: { school: 102 } } }
Example: -
def
$exists(state: ⇒ Boolean): (String, Dictionary[Any])
Matches documents that have the specified field.
Matches documents that have the specified field.
- Annotations
- @inline()
db.inventory.find( { qty: { $exists: true, $nin: [ 5, 15 ] } } )
Example: -
def
$gt(value: ⇒ Any): (String, Dictionary[Any])
Matches values that are greater than a specified value.
Matches values that are greater than a specified value.
- Annotations
- @inline()
db.inventory.find( { qty: { $gt: 20 } } )
Example: -
def
$gte(value: ⇒ Any): (String, Dictionary[Any])
Matches values that are greater than or equal to a specified value.
Matches values that are greater than or equal to a specified value.
- Annotations
- @inline()
db.inventory.find( { qty: { $gte: 20 } } )
Example: -
def
$in(array: ⇒ Array[_]): (String, Dictionary[Any])
Matches any of the values specified in an array.
Matches any of the values specified in an array.
- Annotations
- @inline()
db.inventory.find( { qty: { $in: [ 5, 15 ] } } )
Example: -
def
$inc(delta: ⇒ Double): (String, Dictionary[Any])
- Annotations
- @inline()
{ $inc: { <field1>: <amount1>, <field2>: <amount2>, ... } }
Example: -
def
$lt(value: ⇒ Any): (String, Dictionary[Any])
Matches values that are less than a specified value.
Matches values that are less than a specified value.
- Annotations
- @inline()
db.inventory.find( { qty: { $lt: 20 } } )
Example: -
def
$lte(value: ⇒ Any): (String, Dictionary[Any])
Matches values that are less than or equal to a specified value.
Matches values that are less than or equal to a specified value.
- Annotations
- @inline()
db.inventory.find( { qty: { $lte: 20 } } )
Example: -
def
$meta(text: ⇒ String): (String, Dictionary[Any])
The $meta projection operator returns for each matching document the metadata (e.g.
The $meta projection operator returns for each matching document the metadata (e.g. "textScore") associated with the query.
- Annotations
- @inline()
db.collection.find({}, { score: { $meta: "textScore" } })
Example: -
def
$mod(array: ⇒ Array[_]): (String, Dictionary[Any])
Performs a modulo operation on the value of a field and selects documents with a specified result.
Performs a modulo operation on the value of a field and selects documents with a specified result.
- Annotations
- @inline()
db.inventory.find( { qty: { $mod: [ 4, 0 ] } } )
Example: -
def
$mod(values: Any*): (String, Dictionary[Any])
Performs a modulo operation on the value of a field and selects documents with a specified result.
Performs a modulo operation on the value of a field and selects documents with a specified result.
- Annotations
- @inline()
db.inventory.find( { qty: { $mod: [ 4, 0 ] } } )
Example: -
def
$ne(value: ⇒ Any): (String, Dictionary[Any])
Matches all values that are not equal to a specified value.
Matches all values that are not equal to a specified value.
- Annotations
- @inline()
db.inventory.find( { qty: { $ne: 20 } } )
Example: -
def
$nin(array: ⇒ Array[_]): (String, Dictionary[Any])
Matches none of the values specified in an array.
Matches none of the values specified in an array.
- Annotations
- @inline()
db.inventory.find( { qty: { $nin: [ 5, 15 ] } } )
Example: -
def
$not(expression: ⇒ Any): (String, Dictionary[Any])
Inverts the effect of a query expression and returns documents that do not match the query expression.
Inverts the effect of a query expression and returns documents that do not match the query expression.
- Annotations
- @inline()
db.inventory.find( { price: { $not: { $gt: 1.99 } } } )
Example: -
def
$oid: ObjectID
- Annotations
- @inline()
-
def
$orderby(value: ⇒ Any): (String, Dictionary[Any])
The $orderby operator sorts the results of a query in ascending or descending order.
The $orderby operator sorts the results of a query in ascending or descending order.
- Annotations
- @inline()
db.collection.find( { $query: {}, $orderby: { age : -1 } } )
Example: -
def
$pop(value: ⇒ Any): (String, Dictionary[Any])
Removes the first or last item of an array.
Removes the first or last item of an array.
db.students.update( { _id: 1 }, { $pop: { scores: -1 } } )
Example: -
def
$pull(value: (String, Any)*): (String, Dictionary[Any])
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
- Annotations
- @inline()
{ $pull: { results: { $elemMatch: { score: 8 , item: "B" } } } }
Example: -
def
$pull(value: ⇒ Any): (String, Dictionary[Any])
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
- Annotations
- @inline()
{ $pull: { results: { $elemMatch: { score: 8 , item: "B" } } } }
Example: -
def
$pullAll(array: ⇒ Array[_]): (String, Dictionary[Any])
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
- Annotations
- @inline()
db.survey.update( { _id: 1 }, { $pullAll: { scores: [ 0, 5 ] } } )
Example: -
def
$pullAll(values: Any*): (String, Dictionary[Any])
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
- Annotations
- @inline()
db.survey.update( { _id: 1 }, { $pullAll: { scores: [ 0, 5 ] } } )
Example: -
def
$regex(pattern: ⇒ String, ignoreCase: Boolean = false): (String, Dictionary[Any])
Selects documents where values match a specified regular expression.
Selects documents where values match a specified regular expression.
- Annotations
- @inline()
db.products.find( { sku: { $regex: /^ABC/i } } )
Example: -
def
$set(value: ⇒ Any): (String, Dictionary[Any])
- Annotations
- @inline()
{ $set: { <field1>: <value1>, <field2>: <value2>, ... } }
Example: -
def
$size(count: ⇒ Double): (String, Dictionary[Any])
Selects documents if the array field is a specified size.
Selects documents if the array field is a specified size.
- Annotations
- @inline()
db.collection.find( { field: { $size: 1 } } )
Example: -
def
$slice(count: ⇒ Int): (String, Dictionary[Any])
The $slice operator controls the number of items of an array that a query returns.
The $slice operator controls the number of items of an array that a query returns. For information on limiting the size of an array during an update with $push, see the $slice modifier instead.
- Annotations
- @inline()
db.posts.find( {}, { comments: { $slice: 5 } } )
Example: -
def
$sum(value: ⇒ Double): (String, Dictionary[Any])
- Annotations
- @inline()
count: { $sum: 1 }
Example: -
def
$type(name: ⇒ String): (String, Dictionary[Any])
Selects documents if a field is of the specified type.
Selects documents if a field is of the specified type.
- Annotations
- @inline()
db.data.find( { x: { $type: "minKey" } } )
Example: -
def
=(value: ⇒ Any): (String, Any)
Specifies equality condition.
Specifies equality condition. The $eq operator matches documents where the value of a field equals the specified value.
- Annotations
- @inline()
db.inventory.find( { qty: 20 } )
, db.inventory.find( { qty: { $eq: 20 } } )
Examples: -
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val attribute: String
-
def
between[A, B](values: ⇒ (UndefOr[A], UndefOr[B])): (String, Dictionary[Any])
- Annotations
- @inline()
-
def
between[A, B](minValue: UndefOr[A], maxValue: UndefOr[B]): (String, Dictionary[Any])
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
toString(): String
- Definition Classes
- Any