Integration and Expression 4

I am trying to perform orientation and express integration. I am confused how to make a route to index.js.

Since orientjs has just been launched, I still cannot find the tutorial.

Now I just want to make a simple choice from orientdb.

Can someone please give me some suggestions?

thanks

+4
source share
1 answer

First you need to import Orijs into your express application for which you can make

npm install orientjs --save 

After that, you will need landmarks and create a connection with 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 this is done, you can use "db" to run your request. Now you can use the raw query or Orijs query designer to write your request.

This can be done, for example,

 db.select().from(className).all().then(funtion(res){ console.log(res); },function(err){ console.log(err); }); 
+3
source

All Articles