Init Nest-Neo4j

This commit is contained in:
2022-09-22 10:08:42 +02:00
parent 3e147ae929
commit 2421651a92
51 changed files with 9766 additions and 0 deletions

21
Nest/src/app.service.ts Normal file
View File

@@ -0,0 +1,21 @@
import { Injectable } from '@nestjs/common';
import { Node } from 'neo4j-driver';
import { Neo4jService } from 'src/neo4j/neo4j.service';
export type User = Node;
@Injectable()
export class AppService {
constructor(private readonly neo4jService: Neo4jService) {}
async getHello(): Promise<string> {
const result = await this.neo4jService.read(
`MATCH (n) RETURN count(n) AS count`,
{},
);
const count = result.records[0].get('count');
return `${count} nodes in the database`;
}
}