foxx

Why in ArangoDB module.context.collection return null

て烟熏妆下的殇ゞ 提交于 2019-12-24 10:41:18
问题 I'm trying to learn how to develop Foxx services. There are many examples where people use: const someCollection = module.context.collection('someCollectionName'); But in my project this code doesn't work. someCollection always null, but it's exist in collections. And this code works perfectly: const db = require('@arangodb').db; const someCollection = db._collection('someCollectionName'); My question is why first code isn't work? 回答1: Foxx services are intended to have their own collections,

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

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:

Can't switch to database other than _system within Foxx

三世轮回 提交于 2019-12-12 18:20:00
问题 I'm trying to dynamically generate databases/collections on application startup, in case they do not exist yet. This works fine when working with the _system database. The thing is that it seems not to be allowed when trying to switch to other databases. From the docs: db._useDatabase(name) Changes the current database to the database specified by name. Note that the database specified by name must already exist. Changing the database might be disallowed in some contexts, for example server

AQL template in arango Foxx does not work correctly with array

◇◆丶佛笑我妖孽 提交于 2019-12-11 19:06:52
问题 The below query would not work if I used an array but work normally if we use a string to construct the snippet. Did I make a mistake somewhere or is this one is a bug related to arango? var array=["1","2"] //Make a snippet depend on array. var snippet=aql.literal(`FILTER u.id IN "${array}"`) //Main query. Result is incorrect even though it runs var query=db._query(aql` For u in Collection {$snippet} RETURN u ` ) Example of the correct query using string var string="1" var snippet=aql.literal

Auto scaling resources for foxx/arangodb on mesos

时光怂恿深爱的人放手 提交于 2019-12-11 18:12:48
问题 Is it possible to separately autoscale foxx and arangodb independently of each other in liu of trying to strike balance, and sure enough autoscale right amount of ram/storage/cpu? Simply if it's a good idea to try and autoscale deployment is answer good enough. 回答1: You are not very specific about what you mean by saying "scaling ArangoDB". In general, you can add more DB server nodes (primaries) independent of the number of coordinator nodes, if that is what you're asking. Foxx is executed

Installing ArangoDB Foxx via RESTful API via Python requests results in 'unauthorized' error

跟風遠走 提交于 2019-12-11 11:53:31
问题 We use ArangoDB and Python using the requests module to use Arango's HTTP API. I'm having authorisation problems deploying a Foxx app programically via the HTTP API which we'd like to do as part of our automated testing process. The only program example I can find of uploading an app appears to use obsolete routes. I can upload the zip: http://mydev:8529/_db/mydb/_api/upload I get back: {"filename": "uploads/tmp-13-718410"} ...and the file is there. But then trying this with the post data {

Sending HTTP Post request from node to Foxx service (ArangoDB)

ε祈祈猫儿з 提交于 2019-12-11 06:08:15
问题 I am trying to send a post request from a node + express server to my Foxx service on Arangodb. On the node side : var route = arangopi + '/edge/' + col.name ; var body = {data: data, from: fromId, to: toId} ; console.log('|| body :', route, body) ; >> || body : http//XXX/_db/my-DB/my-foxx-service/path/to/visitedBy { data: { isBackup: true, text: '', isHint: true, continuance: 3441.5 }, from: 'Drop/27237133', to: 'Bot/41116378' } return requestify.post (route, body) On the Foxx side, I

Programmatically creating edges in ArangoDB

痞子三分冷 提交于 2019-12-10 11:21:43
问题 What is the simplest way to quickly create edges in ArangoDB programmatically? I would like to create relationships between documents based on a common attribute. I'd like to be able to select an attribute, and for every document in collection A, create an edge to every document in collection B that has the same value in an equivalent attribute. For example, if I've imported email messages into a collection and people into another collection, I would like to generate edges between the emails

ArangoDB Foxx and Clojure script

拜拜、爱过 提交于 2019-12-06 06:47:18
问题 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? 回答1: 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