dboUpdate = col.findAndModify(query, fields, new BasicDBObject(), false, updateOp, false, true);
// (can use findAndModify because specify index, ie the shard key)
// (returns entity before the changes above, update the feature object below)
// (also atomically creates the object if it doesn't exist so is "distributed-safe")
}
if ( ( dboUpdate != null ) && !dboUpdate.keySet().isEmpty() ) // (feature already exists)
{
// (Update the entity feature to be correct so that it can be accurately synchronized with the index)
EntityFeaturePojo gp = EntityFeaturePojo.fromDb(dboUpdate, EntityFeaturePojo.class);
entFeature.setTotalfreq(gp.getTotalfreq() + nSavedFreqCount);
entFeature.setDoccount(gp.getDoccount() + nSavedDocCount);