I thought this might be helpful (and maybe there's a better way that I 
don't know about)....

I want to hand JSON data back from an AJAX query but don't want all the 
extra overhead of '@rid', etc. on each record so I did this...  (see 
highlighted section below)

var OrientDB = require('orientjs');
var server = OrientDB({ host: 'localhost', port: 2424, username: 'admin', 
password: 'admin' });
var db = server.use({ name: 'MyDb', username: 'admin', password: 'admin' });
console.log('Using database: ' + db.name);
var sql = "SELECT y,x,in(_l0).size() AS n FROM L0 WHERE [y,x] WITHIN :box ORDER 
BY n DESC";
db.query(sql, {
    params: {
        box: coordResult
    },
    limit: 15
}).then(function (results){





*    for (var rec in results)    {        delete results[rec]['@type'];        
delete results[rec]['@rid'];    }*    console.log(results);
});


In fact, I've started to always run this little loop over my results before 
returning.  Sometimes this data is larger than the actual data.

*>> Maybe there's a way to restrict to only the result set?*

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to