com.mongodb
Class DBRef
java.lang.Object
com.mongodb.DBRefBase
com.mongodb.DBRef
public class DBRef
- extends DBRefBase
overrides DBRefBase to understand a BSONObject representation of a reference.
- MongoDB Doc Links
DBRef
public DBRef(DB db,
BSONObject o)
- Creates a DBRef
- Parameters:
db
- the databaseo
- a BSON object representing the reference
DBRef
public DBRef(DB db,
String ns,
Object id)
- Creates a DBRef
- Parameters:
db
- the databasens
- the namespace where the object is storedid
- the object id
fetch
public static DBObject fetch(DB db,
DBObject ref)
- fetches a referenced object from the database
- Parameters:
db
- the databaseref
- the reference
- Returns:
-
- Throws:
MongoException