arangodb

Randomly select a document in ArangoDB

此生再无相见时 提交于 2019-12-23 09:59:55
问题 Is there a way to randomly return a document from a collection using AQL? I would like to create a random graph for testing purposes. I have not yet figured out how to select documents at random from the collection. I was hoping I might be able to do something like this: db._query('RETURN nodes[RAND(0..LENGTH(nodes))]').toArray() JavaScript exception in file '/usr/share/arangodb/js/client/modules/org/arangodb/arangosh.js' at 104,11: [ArangoError 1541: invalid number of arguments for function

Node Express Connect - Session Management

不问归期 提交于 2019-12-23 07:54:59
问题 I've written a session store driver for ArangoDB for ConnectJS. It is working, although still very much in alpha, but I have a couple questions. First sessions that have an expires attribute of "false" only remain for the duration of the user-agent. I've noticed that session.destroy() is not called when the browser window is closed. This results in an "abandoned" session left in the store. How can I effectively clear these out? Is there a way to search for and destroy abandoned sessions on a

What parts of ArangoDB are done with Node-GYP

空扰寡人 提交于 2019-12-23 01:21:31
问题 I am figuring out the structure of ArangoDB to be sure whether it could be my long term solution. One of my important questions is, what parts are made by node-gyp (or Node-Addon) - and how does the query-builder transforms JavaScript generated AQL queries to be fast as native? I know I also could go deeper into the code myself, but I think it is much faster if some of the core developers would answer this (or explain how they expose functionality to JavaScript and AQL). I think it is

Safe removal of vertexes in ArangoDB (using _ids)?

て烟熏妆下的殇ゞ 提交于 2019-12-22 10:53:14
问题 I'm creating some removal queries for vertices and edges in ArangoDB using AQL and I assumed there would be a "safe" way to delete vertices that would also remove associated edges. But I can't find any in the documentation or anywhere else. Is the following the best way to do a safe delete? FOR e IN GRAPH_EDGES('EdgeClass',docId,{direction:'any',maxDepth:1, includeData:false}) REMOVE e._key FROM EdgeClass combined with REMOVE docKey IN DocumentClass Also, is there a way to remove vertices (or

How to set clusters and sharding in ArangoDB?

别等时光非礼了梦想. 提交于 2019-12-22 06:49:34
问题 I want to use sharding in arangoDB.I have made coordinators, DBServers as mentioned in documentation 2.8.5. But still can someone still explain it in details and also how can I able to check the performance of my query after and before sharding. 回答1: Testing your application can be done with a local cluster, were all instances run on one machine - which is what you already did, if I get that correctly? An ArangoDB cluster consists of coordinator and dbserver nodes. Coordinators don't have own

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

混江龙づ霸主 提交于 2019-12-21 16:54:26
问题 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. 回答1: 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

ArangoDB authentication via HTTP

霸气de小男生 提交于 2019-12-21 12:01:37
问题 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 回答1: 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:

How to verify if a graph obeys a power law?

[亡魂溺海] 提交于 2019-12-13 04:46:55
问题 I am using the GraphStream to generate syntethic graphs. What is the formula to verify if the graph obeys the power law? (I have only the number of nodes and edges) Thanks. 回答1: So we have a graph with an edge collection named relations . We can gather the required data using a full table scan on this edge collection using AQL in ArangoDB. We need to unify _from and _to so we can count them. We use the collect statement to evaluate the diameter for each vertex: FOR oneEdge IN relations FOR

Why vertex removing request doesn't remove linked edge with AQL in Arangodb?

浪尽此生 提交于 2019-12-13 03:56:37
问题 I have two document collections and one edge collection. Also I have a graph by this collections. Can I remove vertex from graph with AQL query in Arangodb? How can I remove vertex in graph so that edge will be deleted too? I need to do this with AQL query in Arangodb. If I remove vertex in graphical interface then linked edges is removed too. Why Arangodb doesn't support removing vertices together with their linked edges? Thank you in advance! UPDATE: I have received the answer here: When

Database TypeError in ArangoDB with node.js

醉酒当歌 提交于 2019-12-13 03:48:14
问题 Applying this tutorial without Foxx : http://www.ashishblog.com/getting-start-with-arangodb-using-nodejs-nodejs-ejs-arangojs/ Node.js 8.11.1 (x64) arangoDB 3.3.7-1_win64 arangojs@6.2.4 ERROR MESSAGES IN THE BROWSER @ http://localhost:3000/users TypeError: db.database is not a function at Object.getAllUsers (H:\TEST\app\services\DataServices.js:6:13) at H:\TEST\app\routes\users.js:8:11 at Layer.handle [as handle_request] (H:\TEST\app\node_modules\express\lib\router\layer.js:95:5) at next (H: