sealed trait CollectionIndexesManager extends AnyRef
- Alphabetic
- By Inheritance
- CollectionIndexesManager
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
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.collections.GenericCollection import reactivemongo.api.indexes.Index def createIndexes( coll: GenericCollection[_], 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.collections.GenericCollection def dropIndex(coll: GenericCollection[_], 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.collections.GenericCollection def dropAllIndexes(coll: GenericCollection[_])( 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.collections.GenericCollection import reactivemongo.api.indexes.Index def ensureIndexes( coll: GenericCollection[_], 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.collections.GenericCollection def listIndexes(coll: GenericCollection[_])( 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 to any2stringadd[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 to ArrowAssoc[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( ... ) @native()
-
def
ensuring(cond: (CollectionIndexesManager) ⇒ Boolean, msg: ⇒ Any): CollectionIndexesManager
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager to Ensuring[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 to Ensuring[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 to Ensuring[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 to Ensuring[CollectionIndexesManager] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager to StringFormat[CollectionIndexesManager] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
→[B](y: B): (CollectionIndexesManager, B)
- Implicit
- This member is added by an implicit conversion from CollectionIndexesManager to ArrowAssoc[CollectionIndexesManager] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc