Q:

not able to fetch @rid from result in orientdb function written in javascript

I've written orientdb function in javascript. Want to access @rid from result but unable to fetch @rid.How do u get @rid.Need help on this.
var db = orient.getDatabase();
var result = db.query("select from test where testId = ?",testId);
if(result == null){
     response.send(404,"no data found",'text/plain','no data'); 
}else{
     return result;
}

and response : 
[
    {
        "@type": "d",
        "@rid": "#12:52",
        "@version": 1,
        "@class": "test2",
        "me": "Hrishi"
    }
]

Now how do you get this @rid from this json.

A:

Try this code    
result[0].getIdentity().toString();

