public class

DBApiLayer

extends DB
java.lang.Object
   ↳ com.mongodb.DB
     ↳ com.mongodb.DBApiLayer

Class Overview

Database API This cannot be directly instantiated, but the functions are available through instances of Mongo.

Summary

[Expand]
Inherited Fields
From class com.mongodb.DB
Protected Constructors
DBApiLayer(Mongo mongo, String name, DBConnector connector)
Public Methods
void cleanCursors(boolean force)
void requestDone()
ends the current "consistent request"
void requestEnsureConnection()
ensure that a connection is assigned to the current "consistent request" (from primary pool, if connected to a replica set)
void requestStart()
starts a new "consistent request".
Protected Methods
DBApiLayer.MyCollection doGetCollection(String name)
Returns the collection represented by the string <dbName>.<collectionName>.
[Expand]
Inherited Methods
From class com.mongodb.DB
From class java.lang.Object

Protected Constructors

protected DBApiLayer (Mongo mongo, String name, DBConnector connector)

Parameters
mongo the Mongo instance
name the database name
connector the connector

Public Methods

public void cleanCursors (boolean force)

public void requestDone ()

ends the current "consistent request"

public void requestEnsureConnection ()

ensure that a connection is assigned to the current "consistent request" (from primary pool, if connected to a replica set)

public void requestStart ()

starts a new "consistent request". Following this call and until requestDone() is called, all db operations should use the same underlying connection. This is useful to ensure that operations happen in a certain order with predictable results.

Protected Methods

protected DBApiLayer.MyCollection doGetCollection (String name)

Returns the collection represented by the string <dbName>.<collectionName>.

Parameters
name the name of the collection
Returns
  • the collection