我正在使用java中的neo4j,我有一個問題。當我創建節點時,如何驗證數據庫是否爲空?驗證數據庫是否在neo4j中爲空
這裏是我的代碼來創建一個節點:
br = new BufferedReader(new FileReader(csvFile));
while (br.ready()==true) {
transaction = graphDb.beginTx();
int cont = 0;//limitador de tuplas por query
while ((line = br.readLine()) != null && cont < 10000) {
String[] dado = line.split(cvsSplitBy);
// inserir comando para criar o nós com a data
Node no = graphDb.createNode();
no.setProperty("data", dado[0]);
no.setProperty("temperatura", dado[1]);
no.setProperty("latitude", dado[2]);
no.setProperty("longitude", dado[3]);
no.setProperty("variação", dado[4]);
System.out.println(cont);
cont++;
}
transaction.success();
transaction.close();
}