Class/Object

com.mongodb.casbah

MongoDB

Related Docs: object MongoDB | package casbah

Permalink

class MongoDB extends AnyRef

Wrapper for the Mongo DB object providing scala-friendly functionality.

Since

1.0

See also

com.mongodb.DB

Linear Supertypes
AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MongoDB
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MongoDB(underlying: DB)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addOption(option: Int): Unit

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  5. def apply(collection: String): MongoCollection

    Permalink

    Apply method to proxy getCollection, to allow invocation of dbInstance("collectionName") instead of getCollection

    Apply method to proxy getCollection, to allow invocation of dbInstance("collectionName") instead of getCollection

    collection

    a string for the collection name

    returns

    MongoCollection A wrapped instance of a Mongo DBCollection Class returning generic DBObjects

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collectionExists(collectionName: String): Boolean

    Permalink

    Checks to see if a collection by name %lt;name> exists.

    Checks to see if a collection by name %lt;name> exists.

    collectionName

    The collection to test for existence

    returns

    false if no collection by that name exists, true if a match to an existing collection was found

  9. def collectionNames(): Set[String]

    Permalink

    Returns a set of the names of collections in this database.

    Returns a set of the names of collections in this database.

    returns

    the names of collections in this database

  10. def command(cmd: Imports.DBObject, readPreference: Imports.ReadPreference): CommandResult

    Permalink

    Execute a database command directly.

    Execute a database command directly.

    returns

    the result of the command from the database

    See also

    List of Commands

  11. def command(cmd: String): CommandResult

    Permalink

    Execute a database command directly.

    Execute a database command directly.

    returns

    the result of the command from the database

    See also

    List of Commands

  12. def command(cmd: Imports.DBObject): CommandResult

    Permalink

    Execute a database command directly.

    Execute a database command directly.

    returns

    the result of the command from the database

    See also

    List of Commands

  13. def createCollection(name: String, o: Imports.DBObject): DBCollection

    Permalink

    Creates a collection with a given name and options.

    Creates a collection with a given name and options. If the collection does not exist, a new collection is created. Possible options: <dl> <dt>capped</dt>

    boolean: if the collection is capped
    <dt>size</dt>
    int: collection size
    <dt>max</dt>
    int: max number of documents
    </dl>

    name

    the name of the collection to return

    o

    options

    returns

    the collection

  14. def doEval(code: String, args: AnyRef*): CommandResult

    Permalink
  15. def dropDatabase(): Unit

    Permalink

    Drops this database.

    Drops this database. Removes all data on disk. Use with caution.

  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def eval(code: String, args: AnyRef*): AnyRef

    Permalink
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getCollection(name: String): DBCollection

    Permalink

    Gets a collection with a given name.

    Gets a collection with a given name. If the collection does not exist, a new collection is created.

    name

    (String) the name of the collection to return

    returns

    the collection

  22. def getCollectionFromString(s: String): DBCollection

    Permalink

    Returns a collection matching a given string.

    Returns a collection matching a given string.

    s

    the name of the collection

    returns

    the collection

  23. def getCollectionNames(): Set[String]

    Permalink

    Returns a set of the names of collections in this database.

    Returns a set of the names of collections in this database.

    returns

    the names of collections in this database

  24. def getName: String

    Permalink
  25. def getOptions: Int

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mognodb.Bytes

    com.mongodb.Mongo

  26. def getReadPreference: Imports.ReadPreference

    Permalink

    Gets the read preference for this database.

    Gets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.

  27. def getSisterDB(name: String): MongoDB

    Permalink
  28. def getStats(): CommandResult

    Permalink
  29. def getWriteConcern: Imports.WriteConcern

    Permalink

    get the write concern for this database, which is used for writes to any collection in this database.

    get the write concern for this database, which is used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.

    See also

    WriteConcern

  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. def mapReduce(cmd: map_reduce.MapReduceCommand): MapReduceResult

    Permalink

    The Java Driver is a bit outdated and is missing the finalize option.

    The Java Driver is a bit outdated and is missing the finalize option. Additionally, it returns ZERO information about the actual results of the mapreduce, just a cursor to the result collection. This is less than ideal. So I've wrapped it in something more useful.

    cmd

    An instance of MapReduceCommand representing the required MapReduce

    returns

    MapReduceResult a wrapped result object. This contains the returns success, counts etc, but implements iterator and can be iterated directly

  33. def name: String

    Permalink
  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. def options: Int

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mognodb.Bytes

    com.mongodb.Mongo

  38. def readPreference: Imports.ReadPreference

    Permalink

    Gets the read preference for this database.

    Gets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.

  39. def readPreference_=(pref: Imports.ReadPreference): Unit

    Permalink
  40. def resetOptions(): Unit

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  41. def setReadPreference(pref: Imports.ReadPreference): Unit

    Permalink

    Sets the read preference for this database.

    Sets the read preference for this database. Will be used as default for reads from any collection in this database. See the documentation for com.mongodb.ReadPreference for more information.

    pref

    Read Preference to use

  42. def setWriteConcern(concern: Imports.WriteConcern): Unit

    Permalink

    Set the write concern for this database.

    Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    WriteConcern

  43. def stats(): CommandResult

    Permalink
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  45. def toString(): String

    Permalink
    Definition Classes
    MongoDB → AnyRef → Any
  46. val underlying: DB

    Permalink
  47. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. def writeConcern: Imports.WriteConcern

    Permalink

    get the write concern for this database, which is used for writes to any collection in this database.

    get the write concern for this database, which is used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    WriteConcern

  51. def writeConcern_=(concern: Imports.WriteConcern): Unit

    Permalink

    Set the write concern for this database.

    Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for com.mongodb.WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    WriteConcern

Deprecated Value Members

  1. def slaveOk(): Unit

    Permalink

    Sets queries to be OK to run on slave nodes.

    Sets queries to be OK to run on slave nodes.

    Annotations
    @deprecated @SuppressWarnings()
    Deprecated

    (Since version 2.3.0) Replaced with ReadPreference.SECONDARY.

Inherited from AnyRef

Inherited from Any

Ungrouped