orientjs

OrientDB: How to flatten nested heirarchy into a single record

瘦欲@ 提交于 2021-01-28 12:10:40
问题 I have a structure that looks something like this: How can I traverse my Page and get back a flat record so that each row represents all of data from the root node and its edges. My use case is that I'm producing a csv file. so from the example above, i would like to create a row for each post. Each record should contain all fields from post, the language name, the page name, and the network name. From what I can tell, when you do any kind of traversal, it only gives you the result of the

Best practice for managing OrientDB connections in Express.js / Web Applications

て烟熏妆下的殇ゞ 提交于 2020-01-03 04:43:12
问题 What is the recommended way to manage OrientDB connections in Express.js or any web application for that matter? Connection per request? Would be using the oriento Node.js driver 回答1: If you are using Oriento, you can try connection pooling, as per PR #7 you can set it like this: var server = Oriento({ user: 'root', password: 'foo', pool: { max: 10 // use a maximum of 10 sockets in the pool } }); Please bear in mind that at some point connection pooling config was hidden from Oriento's README

OrientDB get Edges with shortestPath()

落花浮王杯 提交于 2019-12-22 08:49:53
问题 I have a Question about the shortestPath() Function of OrientDB. If I Query select shortestPath('#9:1', '#15:1', 'BOTH') against a OrientDB I just get the Vertex of the Path. But I also want the Edges between them. How can I SELECT both, the Vertex and the Edges? 回答1: You can use a javascript function. I used these records I used this code var g=orient.getGraph(); var b=g.command("sql","select expand(shortestPath(" + start + "," + end + ", 'BOTH'))"); var list=[]; for(i=0;i<b.length-1;i++){

npm install orientjs fatal error. where is node_version.h?

百般思念 提交于 2019-12-11 07:37:23
问题 i wanna use orientjs in below environment. windows 10 pro 64bit node v6.9.2 node-gyp v3.4.0 orientjs 2.2.4 1) install "windows-build-tools" $ npm install --global --production windows-build-tools ...ok... 2) install "orientjs" but, i meet fatal error. where is node_version.h? help me. $ npm install orientjs --save npm WARN deprecated node-uuid@1.4.7: use uuid module instead > orientjs-native@2.2.2 install C:\test1\node_modules\orientjs-native > node-gyp rebuild kt@KT-HOME C:\test1\node

OrientDB get Edges with shortestPath()

北战南征 提交于 2019-12-05 14:37:36
I have a Question about the shortestPath() Function of OrientDB. If I Query select shortestPath('#9:1', '#15:1', 'BOTH') against a OrientDB I just get the Vertex of the Path. But I also want the Edges between them. How can I SELECT both, the Vertex and the Edges? You can use a javascript function. I used these records I used this code var g=orient.getGraph(); var b=g.command("sql","select expand(shortestPath(" + start + "," + end + ", 'BOTH'))"); var list=[]; for(i=0;i<b.length-1;i++){ var rid1=b[i].getId(); var rid2=b[i+1].getId(); var query="select from e where out = " + rid1 + " and in = "