alibaba / alibaba/GraphScope

feat(interactive): Support subtraction between`Date`s

Open
#3,675 1 comment 0 reactions 2 assignees Claimed by @shirly121 View on GitHub
stale
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

```cypher
:param personId: 4398046511268
*/
MATCH (person:Person {id: $personId})<-[:HAS_CREATOR]-(message:Message)<-[like:LIKES]-(liker:Person)
WITH liker, message, like.creationDate AS likeTime, person
ORDER BY likeTime DESC, toInteger(message.id) ASC
WITH liker, head(collect({msg: message, likeTime: likeTime})) AS latestLike, person
RETURN
liker.id AS personId,
liker.firstName AS personFirstName,
liker.lastName AS personLastName,
latestLike.likeTime AS likeCreationDate,
latestLike.msg.id AS commentOrPostId,
coalesce(latestLike.msg.content, latestLike.msg.imageFile) AS commentOrPostContent,
toInteger(floor(toFloat(latestLike.likeTime - latestLike.msg.creationDate)/1000.0)/60.0) AS minutesLatency,
not((liker)-[:KNOWS]-(person)) AS isNew
ORDER BY
likeCreationDate DESC,
toInteger(personId) ASC
LIMIT 20
```

Currently substract is not supported for`Date` type.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.