arangodb

Installing ArangoDB on Windows Server 2008

偶尔善良 提交于 2019-12-24 03:01:09
问题 I'm having difficulty getting Arango 1.4.9 working on my Windows 2008 Standard (SP2) server. It's a fresh install. When I try to start Arango Server I receive this message: The procedure entry point TryAcquireSRWLockExclusive could not be located in the dynamic link library KERNEL32.dll I have tried both the 64bit and 32bit versions. I have run the installer as an administrator and vice versa. Any ideas? 回答1: TryAcquireSRWLockExclusive is from a newer Windows API. The Windows 2008r2 build

How to count number of elements with AQL?

自古美人都是妖i 提交于 2019-12-24 01:46:21
问题 I need to count elements that was in result of SQL query: db._query('FOR v in visitors FILTER v.ip == "127.0.0.1" return COUNT(v.guid) ') This request is return my a length of every GUID, but I need to get total number of GUIDs for example: 2. 回答1: You need to use the result of the query as input for the COUNT function, and then RETURN this result. You can replace the RETURN value of the actual query by 1 for performance reasons: RETURN COUNT(FOR v IN visitors FILTER v.ip == "127.0.0.1"

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

ArangoDB: performance index in array element

折月煮酒 提交于 2019-12-24 00:25:36
问题 I have a Collection in ArangoDB populated with element like this: { "id": "XXXXXXXX", "relation": [ { "AAAAA": "AAAAA", }, { "BBBB": "BBBBBB", "field": { "v1": 0, "v2": 0, "v3": 0 } }, { "CCCC": "CCCC", "field": { "v1": 0, "v2": 1, "v3": 2 } }, ] } I want to return only elements that have field.v1 > 0 (or a combination of v values). I've tried to write an AQL query like this one, but it doesn't use indexes and it is so slow with 200000+ elements. FOR a in X FILTER LENGTH(a.relation) > 0 LET

How to use full text search with arango REST API as I'm always getting empty result?

风流意气都作罢 提交于 2019-12-23 22:01:21
问题 Data in Arango: { "employees": [ { "lastName": "Ansari", "firstName": "Haseb" }, { "lastName": "Ansari", "firstName": "Affan" }, { "lastName": "Keshav", "firstName": "Anil" } ], "_id": "test/124518952473", "_rev": "124518952473", "_key": "124518952473" } Indexing: POST http://localhost:8529/_db/db_test/_api/index?collection=test Body: { "type" : "fulltext", "fields" : [ "lastName" ] } Searching: PUT http://localhost:8529/_db/db_test/_api/simple/fulltext Body: { "collection" : "test",

ArangoDB and user-defined functions or stored procedures

孤人 提交于 2019-12-23 18:37:54
问题 ArangoDB documentation (Foxx section) says: Because Foxx runs directly inside of ArangoDB it lets you bundle all the database queries and logic necessary to handle a request in one place. Is there any additional way, 'more native', than using the 'Foxx framework' to implement something equivalent to user-defined functions or stored procedures in ArangoDB? 回答1: you can use user defined functions which can be used inside of AQL. UDFs have a clear limited scope of just working with the data you

Build API for Django with Foxx or use ArangoDB Python driver?

时光总嘲笑我的痴心妄想 提交于 2019-12-23 13:12:12
问题 I would like to use ArangoDB in Django, but I don't know which of the following options is better: using the ArangoDB Python driver or building a new API with Foxx. I think that the ArangoDB Python driver is not based on Foxx and I don't know the pros and cons of building a new API from scratch, even if it is made easier by Foxx. In addition, I'm afraid that using javascript in the interface between Foxx and the backend could make things slower. Would it be faster if I used Guacamole ODM

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 Too many open files

允我心安 提交于 2019-12-23 12:54:37
问题 since a few days we encounter a problem with our ArangoDB installation. A few minutes/up to an hour after start up all connections to the database are refused. The arango log file says that there are "Too many open files". A "lsof | grep arango | wc -l" shows that the database has around 50,000 open file handles, which is a lot under the max. allowed by the linux system (around 3m). Has anyone an idea where this error comes from? We are using a Ubuntu Linux with a 3.13 kernel. 30 GB RAM and

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