Index

trait Index
Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def ascending(fieldName: String): Index

Create an index key for an ascending index on the given field.

Create an index key for an ascending index on the given field.

Value Params
fieldName

the field name

Returns

the index specification https://docs.mongodb.com/manual/core/index-single/#single-field-indexes

def ascending(fieldNames: Seq[String]): Index

Create an index key for an ascending index on the given fields.

Create an index key for an ascending index on the given fields.

Value Params
fieldNames

the field names, which must contain at least one

Returns

the index specification https://docs.mongodb.com/manual/core/index-single/#single-field-indexes

def combinedWith(anotherIndex: Index): Index

Combines 2 indexes together to create a compound index specifications. If any field names are repeated, the last one takes precedence.

Combines 2 indexes together to create a compound index specifications. If any field names are repeated, the last one takes precedence.

Value Params
anotherIndex

the index to be combined with

Returns

the index specification

def descending(fieldName: String): Index

Create an index key for an descending index on the given field.

Create an index key for an descending index on the given field.

Value Params
fieldName

the field name

Returns

the index specification https://docs.mongodb.com/manual/core/index-single/#single-field-indexes

def descending(fieldNames: Seq[String]): Index

Create an index key for an descending index on the given fields.

Create an index key for an descending index on the given fields.

Value Params
fieldName

the field names, which must contain at least one

Returns

the index specification https://docs.mongodb.com/manual/core/index-single/#single-field-indexes

def geo2d(fieldName: String): Index

Create an index key for a 2d index on the given field.

Create an index key for a 2d index on the given field.

Note: A 2d index is for data stored as points on a two-dimensional plane. The 2d index is intended for legacy coordinate pairs used in MongoDB 2.2 and earlier.

Value Params
fieldName

the field to create a 2d index on

Returns

the index specification https://docs.mongodb.com/manual/core/2d/

def geo2dsphere(fieldName: String): Index

Create an index key for an 2dsphere index on the given field.

Create an index key for an 2dsphere index on the given field.

Value Params
fieldName

the field name

Returns

the index specification https://docs.mongodb.com/manual/core/2dsphere/

def geo2dsphere(fieldNames: Seq[String]): Index

Create an index key for an 2dsphere index on the given fields.

Create an index key for an 2dsphere index on the given fields.

Value Params
fieldNames

the field names, which must contain at least one

Returns

the index specification https://docs.mongodb.com/manual/core/2dsphere/

def hashed(fieldName: String): Index

Create an index key for a hashed index on the given field.

Create an index key for a hashed index on the given field.

Value Params
fieldName

the field to create a hashed index on

Returns

the index specification https://docs.mongodb.com/manual/core/index-hashed/

def text(fieldName: String): Index

Create an index key for a text index on the given field.

Create an index key for a text index on the given field.

Value Params
fieldName

the field to create a text index on

Returns

the index specification https://docs.mongodb.com/manual/core/index-text/

def text: Index

Create an index key for a text index on every field that contains string data.

Create an index key for a text index on every field that contains string data.

Returns

the index specification https://docs.mongodb.com/manual/core/index-text/