trait CollectionMetaCommands extends AnyRef
A mixin that provides commands about this Collection itself.
- Self Type
- CollectionMetaCommands with Collection
- Alphabetic
- By Inheritance
- CollectionMetaCommands
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
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 CollectionMetaCommands to any2stringadd[CollectionMetaCommands] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (CollectionMetaCommands, B)
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to ArrowAssoc[CollectionMetaCommands] 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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
convertToCapped(size: Long, maxDocuments: Option[Int])(implicit ec: ExecutionContext): Future[Unit]
Converts this collection to a capped one.
Converts this collection to a capped one.
- size
the size of the collection (number of bytes)
- maxDocuments
the maximum number of documents this capped collection can contain
-
def
create()(implicit ec: ExecutionContext): Future[Unit]
Creates this collection.
Creates this collection.
The returned future will be completed with an error if this collection already exists.
coll.create().recover { case CommandError.Code(48 /*NamespaceExists*/ ) => println(s"Collection ${coll.fullCollectionName} already exists") }
-
def
createCapped(size: Long, maxDocuments: Option[Int], autoIndexId: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]
Creates this collection as a capped one.
Creates this collection as a capped one.
The returned future will be completed with an error if this collection already exists.
- size
the size of the collection (number of bytes)
- maxDocuments
the maximum number of documents this capped collection can contain
- autoIndexId
If true should automatically add an index on the
_id
field. By default, regular collections will have an indexed_id
field, in contrast to capped collections. This MongoDB option is deprecated and will be removed in a future release.
-
def
drop(failIfNotFound: Boolean)(implicit ec: ExecutionContext): Future[Boolean]
Drops this collection.
Drops this collection.
If the collection existed and is successfully dropped, the returned future will be completed with true.
If
failIfNotFound
is false and the collection doesn't exist, the returned future will be completed with false.Otherwise in case, the future will be completed with the encountered error.
-
def
ensuring(cond: (CollectionMetaCommands) ⇒ Boolean, msg: ⇒ Any): CollectionMetaCommands
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to Ensuring[CollectionMetaCommands] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (CollectionMetaCommands) ⇒ Boolean): CollectionMetaCommands
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to Ensuring[CollectionMetaCommands] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): CollectionMetaCommands
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to Ensuring[CollectionMetaCommands] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): CollectionMetaCommands
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to Ensuring[CollectionMetaCommands] 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[java.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 CollectionMetaCommands to StringFormat[CollectionMetaCommands] 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()
-
def
indexesManager(implicit ec: ExecutionContext): CollectionIndexesManager
Returns an index manager for this collection.
-
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()
-
def
stats(scale: Int)(implicit ec: ExecutionContext): Future[CollStatsResult]
Returns various information about this collection.
Returns various information about this collection.
- scale
the scale factor (for example, to get all the sizes in kilobytes)
-
def
stats()(implicit ec: ExecutionContext): Future[CollStatsResult]
Returns various information about this collection.
-
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
- @native() @throws( ... )
-
def
→[B](y: B): (CollectionMetaCommands, B)
- Implicit
- This member is added by an implicit conversion from CollectionMetaCommands to ArrowAssoc[CollectionMetaCommands] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
Deprecated Value Members
-
def
create(autoIndexId: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]
- autoIndexId
DEPRECATED: If true should automatically add an index on the
_id
field. By default, regular collections will have an indexed_id
field, in contrast to capped collections. This MongoDB option is deprecated and will be removed in a future release.
- Annotations
- @deprecated
- Deprecated
(Since version 0.14.0) Use
create
without deprecatedautoIndexId
-
def
drop()(implicit ec: ExecutionContext): Future[Unit]
Drops this collection.
Drops this collection.
The returned future will be completed with an error if this collection does not exist.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use
drop(Boolean)
-
def
rename(to: String, dropExisting: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]
Renames this collection.
Renames this collection.
- to
the new name of this collection
- dropExisting
if a collection of name
to
already exists, then drops that collection before renaming this one- returns
a failure if the dropExisting option is false and the target collection already exists
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.4) Use
reactivemongo.api.DBMetaCommands.renameCollection on the admin database instead.