Beispiel #1
0
 private void RemoveOldNodes(LongStream idRange)
 {
     using (Transaction transaction = Database.beginTx())
     {
         idRange.mapToObj(id => Database.getNodeById(id)).forEach(Node.delete);
         transaction.Success();
     }
 }
Beispiel #2
0
 private void UpdateOldNodes(LongStream idRange)
 {
     using (Transaction transaction = Database.beginTx())
     {
         IList <Node> nodes = idRange.mapToObj(id => Database.getNodeById(id)).collect(Collectors.toList());
         for (int i = 0; i < NUMBER_OF_INDEXES; i++)
         {
             string propertyName = PROPERTY_PREFIX + i;
             nodes.ForEach(node => node.setProperty(propertyName, RandomRule.nextLong()));
         }
         transaction.Success();
     }
 }