aql

Artifactory AQL Get Specific Properties

眉间皱痕 提交于 2021-02-19 04:26:05
问题 I'm using Artifactory 3.5. My artifacts have custom properties. I want to be able to query for all artifacts that have that property and I want the result to show the property and its value. I know I can use: items.find(...).include("property.*") However, this returns all properties for the item matching the find criteria. How can I display only the specific property that I want? 回答1: The include element allows you to include only specific properties in the results For example, the following

how to check whether a document exists by docID in ArangoDB without getting its real value?

元气小坏坏 提交于 2021-01-29 20:53:05
问题 for c in knows filter DOCUMENT(c._from)==null || DOCUMENT(c._to)==null remove { _key: c._key} IN knows I wonder if the 'document (docID)' condition is slow, and whether the document exists or not according to the document ID, without obtaining its real value. 来源: https://stackoverflow.com/questions/62669204/how-to-check-whether-a-document-exists-by-docid-in-arangodb-without-getting-its

Arangodb groupby query multiple fields

岁酱吖の 提交于 2020-02-25 04:06:14
问题 I have a database of products in an arangodb collection in which a product has multiple sizes. The issue is that for each size, the same product is repeated. But each product has a common group number. Like this: {"name": "product1", "description": "someDescription", size: 5,price: 12 groupNumber: 12} {"name": "product1", "description": "someDescription", size: 15, price: 26, groupNumber: 12} {"name": "product1", "description": "someDescription", size: 25, price: 84, groupNumber: 12} {"name":

AQL- expected join possible in Arangodb and How?

血红的双手。 提交于 2020-01-21 10:17:06
问题 My Environment ArangoDB Version: 3.5.2(the latest i think) Storage Engine:RocksDB Deployment Mode:Single Server Deployment Strategy: Manual Start Infrastructure:own Operating System: Ubuntu 16.04 Total RAM in your machine: 8GB Disks in use: 256GB Problem : I have 2 collection and i have to perform join and want expected result is that possible in Arangodb ?? collection 1 :[ { id :1 , name: "jack" }, { id :2 , name: "ryan" }, { id :3 , name: "sam" }, { id :4 , name: "rick" }, { id :5 , name:

INTERSECTION of (n) arrays in ArangoDB AQL

假如想象 提交于 2020-01-13 18:29: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.

friends of friend Query in ArangoDB 3.0

断了今生、忘了曾经 提交于 2020-01-05 04:17:51
问题 I want to writing 'friends of friend' traversal using AQL I have a Collection with Name: User and a edge Collection with name Conatct . my Conatct documents: I also read this article that implement friends of friend in ArangoDb, but that's post Uses functions of lower version of ArangoDB that used GRAPH_NEIGHBORS() function. in ArnagoDB 3.0(latest version), GRAPH_NEIGHBORS() function have been removed! now, how can I implement fof using Aql in ArnagoDB 3.0 ? thanks a lot 回答1: The graph

Arangodb AQL UPDATE for internal field of object

三世轮回 提交于 2020-01-03 12:32:20
问题 Given the following example document of collection: { "timestamp": 1413543986, "message": "message", "readed": { "8": null, "9": null, "22": null }, "type": "1014574149174" } How do I update the value of specific key in object with key "readed"? For example update value for key "8": ... "8": 10, ... 回答1: You can use MERGE or MERGE_RECURSIVE as follows: db._query("FOR u IN test FILTER u._key == @key UPDATE u WITH 'read': MERGE_RECURSIVE(u.read, { '8': 10 }) } IN test", { key: "11611344050" })

Arangodb AQL UPDATE for internal field of object

半世苍凉 提交于 2020-01-03 12:32:09
问题 Given the following example document of collection: { "timestamp": 1413543986, "message": "message", "readed": { "8": null, "9": null, "22": null }, "type": "1014574149174" } How do I update the value of specific key in object with key "readed"? For example update value for key "8": ... "8": 10, ... 回答1: You can use MERGE or MERGE_RECURSIVE as follows: db._query("FOR u IN test FILTER u._key == @key UPDATE u WITH 'read': MERGE_RECURSIVE(u.read, { '8': 10 }) } IN test", { key: "11611344050" })

Arangodb AQL recursive graph traversal

纵饮孤独 提交于 2019-12-31 03:21:26
问题 I have a graph with three collections which items can be connected by edges. ItemA is a parent of itemB which in turn is a parent of itemC. Elements only can be connected by edges in direction "_from : child, _to : parent" Currently I can get only "linear" result with this AQL query: LET contains = (FOR v IN 1..? INBOUND 'collectionA/itemA' GRAPH 'myGraph' RETURN v) RETURN { "root": { "id": "ItemA", "contains": contains } } And result looks like this: "root": { "id": "itemA", "contains": [ {

Determining which unique constraint caused INSERT failure in ArangoDB

三世轮回 提交于 2019-12-25 08:33:35
问题 I have a document collection in ArangoDB that has multiple unique indexes. When inserting a new document, the insert could fail because of any of the unique indexes. Is there a way to easily figure out which field(s) in the document caused the insert to fail? For example, take a collection that stores user data. Unique indexes on both the "username" and "email" fields mean that an insert could fail if either of those fields are duplicated. Error messages are non-specific: { error: true,