Skip to content

Commit 7851e4e

Browse files
committed
some adjusts
1 parent 4c6dc82 commit 7851e4e

File tree

5 files changed

+7
-74
lines changed

5 files changed

+7
-74
lines changed

components/neo4j_auradb/sources/common/base.mjs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export default {
3232
default: return "";
3333
}
3434
},
35-
_getWhereClause(lastData, type, returnVariable) {
35+
_getWhereClause(lastData, type) {
3636
switch (type) {
37-
case "datetime": return `WHERE ${returnVariable}.${this.orderBy} > datetime("${lastData}")`;
38-
case "sequencial": return `WHERE ${returnVariable}.${this.orderBy} > ${parseInt(lastData)}`;
37+
case "datetime": return `WHERE datetime(n.${this.orderBy}) > datetime.fromepochmillis(${Date.parse(lastData)})`;
38+
case "sequencial": return `WHERE n.${this.orderBy} > ${parseInt(lastData)}`;
3939
default: return "";
4040
}
4141
},
@@ -67,15 +67,11 @@ export default {
6767
_setLastData(lastData) {
6868
this.db.set("lastData", lastData);
6969
},
70-
getVarName() {
71-
return "";
72-
},
7370
async emitEvent(maxResults = false) {
74-
const returnVariable = this.getReturnVariable();
7571
const lastData = this._getLastData();
76-
const whereClause = this._getWhereClause(lastData, this.orderType, returnVariable);
77-
const queryBase = this.getBaseQuery(whereClause, returnVariable);
78-
const query = `${queryBase} RETURN ${returnVariable} ORDER BY ${returnVariable}.${this.orderBy} DESC `;
72+
const whereClause = this._getWhereClause(lastData, this.orderType);
73+
const queryBase = this.getBaseQuery(whereClause);
74+
const query = `${queryBase} RETURN n ORDER BY n.${this.orderBy} DESC `;
7975

8076
const response = this.app.paginate({
8177
query,

components/neo4j_auradb/sources/new-node/new-node.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ export default {
2222
getBaseQuery(whereClause) {
2323
return `MATCH (n:${this.nodeLabel}) ${whereClause}`;
2424
},
25-
getReturnVariable() {
26-
return "n";
27-
},
2825
emit(item) {
2926
const ts = (this.orderType === "dateTime")
3027
? Date.parse(item.properties[this.orderBy])

components/neo4j_auradb/sources/new-query-result/new-query-result.mjs

Lines changed: 0 additions & 46 deletions
This file was deleted.

components/neo4j_auradb/sources/new-query-result/test-event.mjs

Lines changed: 0 additions & 11 deletions
This file was deleted.

components/neo4j_auradb/sources/new-relationship/new-relationship.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ export default {
2020
methods: {
2121
...common.methods,
2222
getBaseQuery(whereClause) {
23-
return `MATCH _=()-[r:${this.relationshipLabel}]->() ${whereClause}`;
24-
},
25-
getReturnVariable() {
26-
return "r";
23+
return `MATCH p=()-[n:${this.relationshipLabel}]->() ${whereClause}`;
2724
},
2825
emit(item) {
2926
const ts = (this.orderType === "dateTime")

0 commit comments

Comments
 (0)