try {
try {
WriteResult writeResult = dbCollection.updateMulti(query.get(), update);
if (writeResult.getError() != null) {
throw new MicroKernelException("Update failed: " + writeResult.getError());
}
if (collection == Collection.NODES) {
// update cache
for (String key : keys) {
@SuppressWarnings("unchecked")
T doc = (T) nodesCache.getIfPresent(key);
if (doc != null) {
applyToCache(collection, doc, new UpdateOp(key, updateOp));
}
}
}
} catch (MongoException e) {
throw new MicroKernelException(e);
}
} finally {
end("update", start);
}
}