Orientdb fetch plan returning ID instead of record

126 Views Asked by At

I am querying a class from the Sails-orientdb adapter for Sailjs. I expect to see last_comment field expanded but it just gives me back the ID. In orientdb studio the same SQL below shows the last_comment expanded

    Questions.query("select * from Questions fetchplan last_comment:0 order by createdAt desc", function (err, retrievedQuestions) {
        if (err) res.send(500,"Error")
        res.send(200, retrievedQuestions);
    });

How can I get the resultset to return expanded?

Orientdb v2.0.12

1

There are 1 best solutions below

4
wolf4ood On

can you try with level:1

Questions.query("select * from Questions fetchplan last_comment:1 order by createdAt desc", function (err, retrievedQuestions) {
        if (err) res.send(500,"Error")
        res.send(200, retrievedQuestions);
    });