bson/src/main/org/bson/BasicBSONObject.java
public ObjectId getObjectId(final String field, final ObjectId def) {
        Object foo = get(field);
        return (foo != null) ? (ObjectId) foo : def;
    }
public ObjectId getObjectId(final String field, final ObjectId def) {
        Object foo = get(field);
        return (foo != null) ? (ObjectId) foo : def;
    }
Returns the object id or def if not set.

@param field The field to return
@param def   the default value in case the field is not found
@return The field object value or def if not set.