如何使用 Gremlin 在 Titan 中获取边缘日期 属性 大于上次访问日期的通知?
How to get notifications that have Edge date property greater than last visited date in Titan using Gremlin?
我的用户顶点具有如下传入的通知边缘:
我用来获取通知的代码
g.v(17929472).outE('Notification')
我得到的响应:
{
"success": true,
"results": [
{
"Type": "UserReaction",
"PostedDate": "2016-04-15T09:03:42.8391677Z",
"NotificationInitiatedByVertexId": "2304",
"_id": "c7bb4-aoagw-sgl-aoao0",
"_type": "edge",
"_outV": 17929472,
"_inV": 17929728,
"_label": "Notification"
}
],
"version": "2.5.0",
"queryTime": 15.310751
}
每当用户查看通知时,我都会保存上次查看的日期,并希望使用该日期获取该日期之后出现的所有通知。
我试过了:
g.v((5124096).outE).outE.has('PostedDate',T.gte, 2016-04-15T07:52:31.6979843Z).inV
但它给出了错误。
PostedDate
似乎作为字符串返回。考虑在您的架构定义中将 PostedDate
定义为 Long
,然后将 T.gte
与 Long
值进行比较。
我的用户顶点具有如下传入的通知边缘:
我用来获取通知的代码
g.v(17929472).outE('Notification')
我得到的响应:
{
"success": true,
"results": [
{
"Type": "UserReaction",
"PostedDate": "2016-04-15T09:03:42.8391677Z",
"NotificationInitiatedByVertexId": "2304",
"_id": "c7bb4-aoagw-sgl-aoao0",
"_type": "edge",
"_outV": 17929472,
"_inV": 17929728,
"_label": "Notification"
}
],
"version": "2.5.0",
"queryTime": 15.310751
}
每当用户查看通知时,我都会保存上次查看的日期,并希望使用该日期获取该日期之后出现的所有通知。
我试过了:
g.v((5124096).outE).outE.has('PostedDate',T.gte, 2016-04-15T07:52:31.6979843Z).inV
但它给出了错误。
PostedDate
似乎作为字符串返回。考虑在您的架构定义中将 PostedDate
定义为 Long
,然后将 T.gte
与 Long
值进行比较。