Search code examples
graphorientdbgraph-databasesorientdb-etl

Orient DB place for save javascript function query's etc


Hi I have orient DB its really nice cool database, but I need to do some operations thru http rest, for example external client will call orientDB function get me last 100 customers ... but the query behind will by big wit lot of relations traverse etc. I wanna save the function on orient DB but how can I manage functions or version with git need some tool for that I will have maybe 50 different function and behind every function will be long query which I need to maintenance please give me advice thanks


Solution

  • You could export/import the OrientDB functions as json with the command (example from the console):

    orientdb> EXPORT DATABASE functions.json -includeClass=OFunction -includeInfo=FALSE 
          -includeClusterDefinitions=FALSE -includeSchema=FALSE 
          -includeIndexDefinitions=FALSE -includeManualIndexes=FALSE
    

    So you could use git to version them. To import the functions into the database you can use:

    orientdb> IMPORT DATABASE functions.json 
    

    And only the functions will be overridden.