Implement toDBObject() method.