code: private int cleanUpOldCmdbItems(List<String> configurationItemNameList) {
          int inValidCount = 0;
          for(Cmdb cmdb:  cmdbRepository.findAllByValidConfigItem(true)){
              String configItem = cmdb.getConfigurationItem();
  
              if(configurationItemNameList != null && !configurationItemNameList.contains(configItem)){
                  cmdb.setValidConfigItem(false);
                  cmdbRepository.save(cmdb);
                  inValidCount++;
              }
          }
          return inValidCount;
      }
docs: Takes configurationItemNameList (list of all APP/component names) and List<Cmdb> from client and sets flag to false for old items in mongo
  @param configurationItemNameList
  @return return count of items invalidated