arangodb

Arangodb custom filter/visitor for my tree graph

浪子不回头ぞ 提交于 2019-12-06 02:57:00
I have a graph with two edge definitions like this: isDepartment: [organisation] -> [organisation] hasAccess: [user] -> [organisation] Organisations are nested in a tree (no cycles). There are multiple top-level organisations without any incoming isDepartment edges. Users are granted access to one or more organisations. These can be top-level organisations or organisations somewhere lower down the tree. If a user has access to an organisation, it has access to all child organisations. I am trying to build a custom visitor or filter that gives me all accessible organisations for a user,

ArangoDB - how to perform computations in graph traversals?

非 Y 不嫁゛ 提交于 2019-12-05 23:13:59
I have a simple graph for keeping a track of people whom I have lent money to. So the graph looks like this: userB -- owes to (amount: 200) --> userA userC -- owes to (amount: 150) --> userA and so on... Lets say you need to find out how much money each user is owed, using a graph traversal. How do you implement this? Let me explain this using the city example graph Vertices (cities) have a numeric attribute, population ; Edges (highways) have a numeric attribute distance . Inspecting what we expect to sumarize: FOR v, e IN 1..1 INBOUND "frenchCity/Lyon" GRAPH "routeplanner" RETURN {city: v,

Passing parameters to db.query with arangojs

此生再无相见时 提交于 2019-12-05 23:09:10
问题 I'm having problems sending parameters with the ArangoJS library and was wondering if anyone could help. With the example below, it is possible to execute db.query if parameter values are in the query, but as soon as I try to use bindVars I get silent errors and I can't extract any error details. var db = require('arangojs')("http://127.0.0.1:8529"); /* The '_system' database contains a collection called 'test' that contains one document: { "a": 1, "b": 2 } */ // This works db.query('FOR t IN

INTERSECTION of (n) arrays in ArangoDB AQL

爷,独闯天下 提交于 2019-12-05 18:35:05
The scenario is this: I have an ArangoDB collection containing items, and another collection containing tags. I am using a graph, and I have an edge collection called "Contains" connecting the items and tags. An item has multiple tags. Now I am trying to do a search for items containing multiple tags. E.g. items containing the tags "photography", "portrait" and "faces". My general approach is to start a graph traversal from each of the tag vertices and find the items that relate to that tag. That part works fine. I get a list of items. But the last part of my task is to make an intersection of

ArangoDB Transactions - How prevent from throwing exceptions

試著忘記壹切 提交于 2019-12-05 14:30:52
How to prevent ArangoDB from throwing an exception during the Transaction when looking for a specific document which perhaps does not exist at that moment? Nodejs sends the transaction in one block to ArangoDb where it gets processed. That's perfect. I want to unload all math to the server. During the Transaction, I want to look at a specific Collection and check if a document exists, if document can be found, then get field 'balance', but if the Document cant be found or their field, then I dont want to throw an exception and dont want to stop the ongoing transaction. On the contrary, I much

How to store images in ArangoDB?

≡放荡痞女 提交于 2019-12-05 12:46:36
I want to store images in ArangoDb as image file. I want to know if there is any API or Java API for the same. Thanking You in advance. Storing binary data inside ArangoDB has been a long standing feature request . Currently its not possible out of the box. One can however do this by creating a foxx service that handles the data. The recommended way is to create a file and reference that file name inside the database. A detailed description and an example foxx app can be found in the cookbook 来源: https://stackoverflow.com/questions/35038637/how-to-store-images-in-arangodb

ArangoDB Foxx and Clojure script

徘徊边缘 提交于 2019-12-04 12:53:09
I'd like to implement a Foxx service using ClojureScript. I've read that one can use Typescript and Coffeescript by running the transpiler during each development step; Can I do similar for ClojureScript ? As far as we know, it is not possible to write ClojureScript applications in such a way that they could run in ArangoDB/Foxx. Unlike TypeScript and CoffeeScript, ClojureScript is not just a language but an application runtime. It's better to think of it not as an alternative syntax for JavaScript but as a way to write applications that happen to be executed on a JavaScript engine. In other

ArangoDB: Get every node, which is in any way related to a selected node

点点圈 提交于 2019-12-04 08:26:30
I have a simple node-links graph in ArangoDB. How can I traverse from 1 preselected node and return all nodes which are related to it? For example: A→B, B→C, C→D, C→E, F→B, F→E Selecting any of them should return the same result (all of them). I am very new to ArangoDB. What you need is AQL graph traversal , available since ArangoDB 2.8. Older versions provided a set of graph-related functions, but native AQL traversal is faster, more flexible and the graph functions are no longer available starting with 3.0. AQL traversal let's you follow edges connected to a start vertex, up to a variable

ArangoDB authentication via HTTP

情到浓时终转凉″ 提交于 2019-12-04 05:59:44
I've seen examples of how to authenticate with a database using arangosh, but I couldn't find anything in the documentation about how to authenticate via the http API. Is this possible? Is it something like this: http://username:passwd@arangouri.com:8529/_api/document Ok, after playing around with authentication in Arango DB on Windows here is what I have found: I could not get this command to work (which is supposed to enable authentication) --server.disable-authentication false UPDATE: I realized I couldn't get this command working because it's not a command at all :-o After looking more

Passing parameters to db.query with arangojs

廉价感情. 提交于 2019-12-04 05:03:19
I'm having problems sending parameters with the ArangoJS library and was wondering if anyone could help. With the example below, it is possible to execute db.query if parameter values are in the query, but as soon as I try to use bindVars I get silent errors and I can't extract any error details. var db = require('arangojs')("http://127.0.0.1:8529"); /* The '_system' database contains a collection called 'test' that contains one document: { "a": 1, "b": 2 } */ // This works db.query('FOR t IN test FILTER t.a == 1 RETURN t') .then((cursor) => { cursor.all() .then(vals => { console.log("\nNo