sealed trait CollectionIndexesManager extends AnyRef
- Alphabetic
- By Inheritance
- CollectionIndexesManager
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- type Index = indexes.Index { type Pack = CollectionIndexesManager.this.Pack }
- abstract type Pack <: SerializationPack
Abstract Value Members
- abstract def create(index: Index): Future[WriteResult]
Creates the given index.
Creates the given index.
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.CollectionMetaCommands import reactivemongo.api.indexes.Index def createIndexes( coll: CollectionMetaCommands, is: Seq[Index.Default])( implicit ec: ExecutionContext): Future[Unit] = Future.sequence( is.map(idx => coll.indexesManager.create(idx))).map(_ => {})
_Warning_: given the options you choose, and the data to index, it can be a long and blocking operation on the database. You should really consider reading http://www.mongodb.org/display/DOCS/Indexes before doing this, especially in production.
- index
the index to create
- abstract def drop(indexName: String): Future[Int]
Drops the given index on that collection.
Drops the given index on that collection.
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.CollectionMetaCommands def dropIndex(coll: CollectionMetaCommands, name: String)( implicit ec: ExecutionContext): Future[Int] = coll.indexesManager.drop(name)
- indexName
the name of the index to be dropped
- returns
The number of indexes that were dropped.
- abstract def dropAll(): Future[Int]
Drops all the indexes on that collection.
Drops all the indexes on that collection.
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.CollectionMetaCommands def dropAllIndexes(coll: CollectionMetaCommands)( implicit ec: ExecutionContext): Future[Int] = coll.indexesManager.dropAll()
- returns
The number of indexes that were dropped.
- abstract def ensure(index: Index): Future[Boolean]
Creates the given index only if it does not exist on this collection.
Creates the given index only if it does not exist on this collection.
The following rules are used to check the matching index: - if
nsIndex.isDefined
, it checks using the index name, - otherwise it checks using the key.import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.CollectionMetaCommands import reactivemongo.api.indexes.Index def ensureIndexes( coll: CollectionMetaCommands, is: Seq[Index.Default])( implicit ec: ExecutionContext): Future[Unit] = Future.sequence( is.map(idx => coll.indexesManager.ensure(idx))).map(_ => {})
_Warning_: given the options you choose, and the data to index, it can be a long and blocking operation on the database. You should really consider reading http://www.mongodb.org/display/DOCS/Indexes before doing this, especially in production.
- index
the index to create
- returns
true if the index was created, false if it already exists.
- abstract def list(): Future[List[Index]]
Lists the indexes for the current collection.
Lists the indexes for the current collection.
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.CollectionMetaCommands def listIndexes(coll: CollectionMetaCommands)( implicit ec: ExecutionContext): Future[List[String]] = coll.indexesManager.list().map(_.flatMap { idx => idx.name.toList })
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toany2stringadd[CollectionIndexesManager] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (CollectionIndexesManager, B)
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toArrowAssoc[CollectionIndexesManager] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def ensuring(cond: (CollectionIndexesManager) => Boolean, msg: => Any): CollectionIndexesManager
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toEnsuring[CollectionIndexesManager] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (CollectionIndexesManager) => Boolean): CollectionIndexesManager
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toEnsuring[CollectionIndexesManager] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): CollectionIndexesManager
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toEnsuring[CollectionIndexesManager] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): CollectionIndexesManager
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toEnsuring[CollectionIndexesManager] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toStringFormat[CollectionIndexesManager] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.
- def →[B](y: B): (CollectionIndexesManager, B)
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager toArrowAssoc[CollectionIndexesManager] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.