File size: 1,557 Bytes
34367da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { config } from 'dotenv';
import { resolve } from 'path';
import { fileURLToPath } from 'url';
import neo4j from 'neo4j-driver';

const __dirname = fileURLToPath(new URL('.', import.meta.url));
config({ path: resolve(__dirname, '../../.env') });

const NEO4J_URI = process.env.NEO4J_URI || 'bolt://localhost:7687';
const NEO4J_USERNAME = process.env.NEO4J_USERNAME || 'neo4j';
const NEO4J_PASSWORD = process.env.NEO4J_PASSWORD || 'password';

async function check() {
    const driver = neo4j.driver(NEO4J_URI, neo4j.auth.basic(NEO4J_USERNAME, NEO4J_PASSWORD));
    const session = driver.session();
    try {
        // Verify counts
        const countResult = await session.run('MATCH (n) RETURN count(n) as count');
        const total = countResult.records[0].get('count').toNumber();
        console.log(`Total Nodes: ${total}`);

        // Specific verification
        const result = await session.run("MATCH (n:File) WHERE n.name CONTAINS 'Neo4jAdapter' RETURN n.name as name, n.path as path");
        if (result.records.length > 0) {
             console.log("✅ Verification found Neo4jAdapter files:");
             result.records.forEach(r => {
                 console.log(` - ${r.get('name')} (${r.get('path')})`);
             });
        } else {
             console.log("❌ Verification FAILED: No 'Neo4jAdapter' files found.");
        }

    } catch(e) {
        console.error("Error:", e);
    } finally {
        await session.close();
        await driver.close();
    }
}
check();