Hi Andy, 1) foxx doesn't offer a graph specific way to calculate collections. However, as you already found out *in the context (see *https://docs.arangodb.com/3.0/Manual/Foxx/Context.html ) you can find the *collectionPrefix* or the collectionName() function. You would prefix the name of the graph, your vertex and edge collections with that when creating the graph so you can use several instances of the service on the same server without collisions. (as you already sugested)
2) You would rather have the edge-collections being specialized in several collections so that you can choose subsets of your graph to query, like: cityToVenue, cityToEvent, etc. You then could use anonymous graph traversals that only specify the edge collections you're interested in: (picking https://docs.arangodb.com/3.0/Manual/Graphs/index.html#the-city-graph for demonstration) db._query("FOR v IN 1..5 INBOUND 'germanCity/Cologne' germanHighway RETURN v._key").toArray() [ "Berlin", "Hamburg", "Berlin" ] so in this query we skip the edge collections internationalHighway and frenchHighway ruling out the french cities available in the example. Cheers, Willi On Thursday, June 23, 2016 at 9:43:36 PM UTC+2, Andy Barilla wrote: > > These are in regards to 3.0 if that makes a difference. > > 1) To confirm, graphs are not ever part of a Foxx app so if you have a > named graph in a database you have to access the vertices collection like > so: > > const graphModule = require('@arangodb/general-graph'); > const cityVenues = graphModule._graph('cityVenues'); > > cityVenues[module.context.collectionName('venues')].remove(venueKey); > > Is this correct? > > If so, is there a module.context variable that I can use to get the prefix > of the Foxx app? That way I can create the graph in the Foxx setup.js with > the matching prefix to the tables to ensure there is a graph per mounted > app if I need that. > > 2) Suppose I have three types of vertices: city, venue & event. Sometimes > I just need to access the city & venue parts of the graph and other times I > need to access all three. Assume the amount of city & venue only calls is > about the same as calls which need all three types. > > What are the advantages/disadvantages of: 1 graph with all three vertices > or 2 graphs one of which has just city & venue and the other which has all > three? > > Personally, I'm more concerned with read speed than write speed. > -- You received this message because you are subscribed to the Google Groups "ArangoDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
