Reputation: 529
I have a piece of JSON that printed to console looks like:
{ '@rid': RecordID { cluster: 45, position: 40 } }
Stringifying this returns:
{"@rid":"#45:40"}
However, I'd prefer if the RecordID was not converted to a string.
I can pick out the individual values by:
json["@rid"].cluster // returns 45
json["@rid"].position // returns 40
But handling the RecordID directly always returns an error. How can I avoid that?
Upvotes: 1
Views: 91
Reputation: 108
This is half an answer but there's a parse method:
const RID = require('orientjs').RecordID;
RID.parse(result['@rid'])
Is returns a record, but not the string that would be, you know, useful.
Upvotes: 0