How to get notifications that have Edge date property greater than last visited date in Titan using Gremlin?

210 Views Asked by At

I'm having user vertices which have incoming Notification edges as follows:

code am using to get notifications

g.v(17929472).outE('Notification')

Response I'm getting :

{
  "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
}

Whenever user view the notification i'm saving the last seen date and want to use that date to get all notification that is present after that date.

I've tried :

g.v((5124096).outE).outE.has('PostedDate',T.gte, 2016-04-15T07:52:31.6979843Z).inV

but it is giving error.

1

There are 1 best solutions below

4
Jason Plurad On BEST ANSWER

PostedDate appears to be returned as a String. Consider defining PostedDate in your schema definition as a Long instead, and then do the T.gte comparison with a Long value.