List<Map<String, Object>> l = (List<Map<String, Object>>) dataMap.get("records");
for (Map<String, Object> m : l) {
Map<String, Object> rec = (Map<String, Object>) m.get("record");
final BasicDBObject dbo = new BasicDBObject();
dbo.putAll(rec);
mongoTemplate.execute("records", new CollectionCallback<Object>() {
public Object doInCollection(DBCollection collection) throws MongoException, DataAccessException {
collection.insert(dbo);
return null;
}
});