aql

When graph consistency will be implemented in ArangoDB java driver?

霸气de小男生 提交于 2019-12-25 03:38:34
问题 Some time ago I asked about deleting vertices with associated edges. The answer was that the edges don't deleted automatically by AQL when vertices are deleted. I use Arango java driver for working with ArangoDB. My questions are: When graph consistency will be implemented in ArangoDB java driver and edges will be deleted automatically by AQL when vertices are deleted? Is it planned? Thank you in advance! 回答1: I received the answer directly from ArangoDB contributors and they said that in v 3

AQL how to collect documents into arrays under their collection name?

北战南征 提交于 2019-12-24 00:42:43
问题 In answer to previous questions was shown how to collect documents under their collection names but there was a clear constraint that query returns only one document for each collection. @CoDEmanX asked what if the query returns many documents of the same collection? 回答1: Will have to rework query to use aggregation: FOR doc IN ANY "vertex/key" edge_collection COLLECT collection = PARSE_IDENTIFIER(doc).collection INTO collected RETURN MERGE({ [collection]: collected[*].doc }) Group documents

Whats the best method to to filter graph edges by type in AQL

给你一囗甜甜゛ 提交于 2019-12-23 13:06:31
问题 I have the following super-simple graph : What i am trying to do is: Select all questions where there is a property on the question document called firstQuestion with a value of true. Select any options that are connected to the question via an outbound edge of type with_options The following query works, however it feels like there must be a better way to inspect the edge type without using string operations - specifically the concatenation operation i use to recreate the edge _id value by

ArangoDB Index usage with edge collections

别等时光非礼了梦想. 提交于 2019-12-23 12:25:02
问题 Task: Fastest way to update many edges attributes. For performance reasons, I am ignore graph methods and work with collection directly for filtering. ArangoDB 2.8b3 Query [Offer - edge collection]: FOR O In Offer FILTER O._from == @from and O._to == @to and O.expired > DATE_TIMESTAMP(@newoffertime) UPDATE O WITH { expired: @newoffertime } IN Offer RETURN { _key: OLD._key, prices_hash: OLD.prices_hash } I have system index on _to, _from and range index on expired Query explain show 7 edge

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

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 fetch records set with a ttl of -1 in aerospike?

我与影子孤独终老i 提交于 2019-12-13 16:23:52
问题 I have so many records in aerospike, i want to fetch the records whose ttl is -1 please provide solution 回答1: Just to clarify, setting a TTL of -1 in the client means never expire (equivalent to a default-ttl of 0 in the server's aerospike.conf file), while setting a TTL of 0 in the client means inherit the default-ttl for this namespace . With Predicate Filtering: If you're using the Java, C, C# and Go clients the easiest way to identify the records with a void time of 0 would be to use a

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

Can graph db solve my graph problems?

纵饮孤独 提交于 2019-12-13 00:04:54
问题 I have transactions data (pastebin.com/ZswbyVHM) like this: {"accountId":3,"recordedAt":"2013-12-01T00:00:00.000Z","region":"South","status":"H"} {"accountId":3,"recordedAt":"2014-01-01T00:00:00.000Z","region":"South","status":"A"} {"accountId":3,"recordedAt":"2014-02-01T00:00:00.000Z","region":"South","status":"B"} {"accountId":3,"recordedAt":"2014-03-01T00:00:00.000Z","region":"South","status":"E"} {"accountId":3,"recordedAt":"2014-04-01T00:00:00.000Z","region":"South","status":"C"} when

retrieve vertices with no linked edge in arangodb

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 12:07:29
问题 What is the best way to retrieve all vertices that do not have an edge in a related edge_collection I've tried to use the following code but it's got incredibly slow since arangodb 2.8 (It was not really fast in previous versions but round about 10 times faster as now). It takes more than 30 seconds on collection sizes of around 1000 edges and around 3000 vertices. FOR v IN vertex_collection FILTER LENGTH( EDGES(edge_collection, v._id, "outbound"))==0 RETURN v._id ... update ... After playing