Hello,
I am working with a data source from the US deparment of education ( http://ope.ed.gov/accreditation/). There are just over 26 thousand rows in the csv file. My code happily inserts java objects into my mongo repository. Unfortunately, it silently disgards about 2/3 of them. For example, if I insert the first 10 rows from the csv into Mongo, only 3 are recorded. Why?
Is there some error(code/exception/log) I am ignoring on inserts which do not work? Things I thought to check.
- Added a try block with a catch block for both DataAccessException and Exception. No exception thrown.
- I see no error messages in the mongo.log file
- MongoTemplate.insert() returns void (ie, no error code).
Consider
Turns out the instituteId which I thought was unique for each row isn't unique. What is suppose to happen in this case? It appears to silently ignore inserts where the @Id already exists. Is that right? Is there a way to make this collision explicit during debugging?Code:@Document(collection="institutions") public class AccreditedPostsecondaryInstitution extends Places { @SuppressWarnings("unused") @Id private String instituteId;
-jk


Reply With Quote