OrientDB

Embedding record from function in OrientDB

回眸只為那壹抹淺笑 提交于 2019-12-11 17:27:06
问题 I'd like to embed a record into another one using a function in OrientDB. I have a class called Backup. Here's it's definition: create class Backup extends V create property Backup.dateTime datetime create property Backup.record embedded V What I want to do is to call an OrientDB function, passing it an arbitrary @rid, and it will make a backup of that record for me. Here's what I tried so far: //function createBackup(id) var gdb = orient.getGraphNoTx(); var rec = gdb.command("sql", "select

Making custom User that extends V and OUser

元气小坏坏 提交于 2019-12-11 14:27:00
问题 I need to create a User class that allows for both record-level security as well as vertex properties, but OUser already extends OIdentity . I'm also wondering if there's a way to get rid of the automatically generated admin user, as it seems redundant that I can connect to my database using the root user defined in the orientdb-server-config.xml , and I don't need that user (at least right now). 回答1: You can let OIdentity to extend V: alter class OIdentity superclass V So now OUser and ORole

How to create database on OritentDB using OrientDB-NET.binary driver for C#?

 ̄綄美尐妖づ 提交于 2019-12-11 13:46:30
问题 I'm starting to learn OrientDB using OrientDB-NET.binary driver for C# and I have successfully configured and ran OrientDB as server. Now I just tried to run a connection using OClient.CreateDatabasePool as described here https://github.com/yojimbo87/OrientDB-NET.binary/wiki OClient.CreateDatabasePool( "127.0.0.1", 2424, "TestDatabaseName", ODatabaseType.Graph, "admin", "admin", 10, "myTestDatabaseAlias"); and Im getting this error: com.orientechnologies.orient.core.exception

Fetching all the paths between two nodes using gremlin in java

↘锁芯ラ 提交于 2019-12-11 13:17:48
问题 Hi I am kinda new to gremlin and trying to achieve some solve by finding all the paths between two nodes. In simple query on gremlin console I was able to do that using this query : (Name of the first Node).loop(1){it.loops<100}{true}.has('name', (Name of the second node)).path{it.name} But while I was trying to fetch that from java methods I am into sea of problems, like: -- no clue on where to put the query exactly ? -- what data structure will be right to receive the array of rows. -- how

Trying to work with OrientDB

你离开我真会死。 提交于 2019-12-11 13:16:31
问题 I am trying this simple code: import java.util.List; import com.orientechnologies.orient.core.exception.OStorageException; import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; import com.orientechnologies.orient.object.db.OObjectDatabasePool; import com.orientechnologies.orient.object.db.OObjectDatabaseTx; public class ProgramOrientDB { private static TestObjectFiller filler = new TestObjectFiller(); private static interface DBCallback<T> { T call(OObjectDatabaseTx db) throws

OrientDB create edge issue in batch/script

不羁岁月 提交于 2019-12-11 12:40:10
问题 I have 2 problems with edge creation. First , I'm creating a bunch of vertices and edges with a batch command. Sometimes and edge is created between vertices that havent been created yet (it depends on the input order, and for now that cannot be controlled) . Of course Orient server throws an exception instead of failing silently. I couldnt find a way of telling it to skip it or avoid creating the edge. In Neo4j you can do: MATCH (a {id:'zz'}),(b {id:'yy'}) CRAETE UNIQUE (a)-[r:REL {'id': 'xx

Creating a database in Orientdb in distributed mode

南楼画角 提交于 2019-12-11 12:30:26
问题 Our system creates OrientDB databases programmatically and uses one database for each customer (before anyone jump on dismissing this design, the reasons are security, possibility to move certain customer/data between datacenters/regions and the possibility to relocation to on-premise). This works great in OrientDB in single mode. However, when the database is setup in distributed mode (3 servers, on amazon). The behaviour is, to put it mildly, weird. I know the docs doesn't say anything

OrientDB Time Span Search Query

删除回忆录丶 提交于 2019-12-11 11:58:13
问题 In OrientDB I have setup a time series using this use case. However, instead of appending my Vertex as an embedded list to the respective hour I have opted to just create an edge from the hour to the time dependent Vertex. For arguments sake lets say that each hour has up to 60 time Vertex each identified by a timestamp. This means I can perform the following query to obtain a specific desired Vertex: SELECT FROM ( SELECT expand( month[5].day[12].hour[0].out() ) FROM Year WHERE year = 2015)

“value is not a record or a record-id” when passing batch variable to “set =” in update

◇◆丶佛笑我妖孽 提交于 2019-12-11 11:57:06
问题 EDIT : see at bottom for reproduce the problem on a smaller stat/schema set I'm experimenting around OrientDB time-series use case and I'm trying to chain each levels of two trees. So I did this sql batch : let $w1 = select expand(W1[2406]) from #12:2; let $w2 = select expand(W1[2407]) from #12:2; let $d1 = select expand(D1[4]) from $w1; let $d2 = select expand(D1[0]) from $w2; let $h1 = select expand(H1[23]) from $d1; let $h2 = select expand(H1[0]) from $d2; let $m1 = select expand(M1[59])

Waterline Transaction through sails-orientdb

帅比萌擦擦* 提交于 2019-12-11 10:57:31
问题 I'm using transaction in the following code, can I enhance this code furthermore? var db = itemsModel.getDB(); var trans = db.begin(); trans.update('items') .set({status:UNAVAILABLE}) .where({id:items_ids_list,status:AVAILABLE}).exec() .then(function(items){ if (items.length != items_ids_list.length) { trans.rollback(); /* send error here*/ } else trans.commit(); }); 来源: https://stackoverflow.com/questions/29586175/waterline-transaction-through-sails-orientdb