com.mongodb.casbah

MongoDB

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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MongoDB
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MongoDB(underlying: DB)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addOption(option: Int): Unit

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  7. def apply(collection: String): MongoCollection

    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

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

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

    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

  11. def collectionNames(): Set[String]

    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

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

    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 command(cmd: String): CommandResult

    Execute a database command directly.

    Execute a database command directly.

    returns

    the result of the command from the database

    See also

    List of Commands

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

    Execute a database command directly.

    Execute a database command directly.

    returns

    the result of the command from the database

    See also

    List of Commands

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

    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

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

  17. def dropDatabase(): Unit

    Drops this database.

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

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

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

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

  21. def finalize(): Unit

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

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

    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

  24. def getCollectionFromString(s: String): DBCollection

    Returns a collection matching a given string.

    Returns a collection matching a given string.

    s

    the name of the collection

    returns

    the collection

  25. def getCollectionNames(): Set[String]

    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

  26. def getName: String

  27. def getOptions: Int

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mognodb.Bytes

    com.mongodb.Mongo

  28. def getReadPreference: Imports.ReadPreference

    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.

  29. def getSisterDB(name: String): MongoDB

  30. def getStats(): CommandResult

  31. def getWriteConcern: Imports.WriteConcern

    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

  32. def hashCode(): Int

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

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

    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

  35. def name: String

  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  39. def options: Int

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mognodb.Bytes

    com.mongodb.Mongo

  40. def readPreference: Imports.ReadPreference

    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.

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

    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 resetOptions(): Unit

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

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

    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

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

    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

  45. def stats(): CommandResult

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

    Definition Classes
    AnyRef
  47. def toString(): String

    Definition Classes
    MongoDB → AnyRef → Any
  48. val underlying: DB

  49. final def wait(): Unit

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

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

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

    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

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

    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

    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