You first need to import orientjs in your express application for which you can do
npm install orientjs --save
After this require orientjs and create a connection to the orientDb.
var orientJs = require('orientjs');
var orientDb = OrientJs({
host: "yourhostName",
port: "orientdb Port ",
username: "OrientDB user Name",
password: "password"
});
Now specify the database you want to connect to
var db = orientDb.use({
name: 'database name',
username: 'database user',
password: 'password'
});
Once that is done you can use "db" to run your query. Now you can use raw query or orientjs query builder to write your query.
This can be done like
db.select().from(className).all().then(funtion(res){
console.log(res);
},function(err){
console.log(err);
});