Implement toDBObject() and fromDBObject() methods.