Monday, 15 February 2010

sails.js - Waterline Edges associations -


I have just prepared a model that contains two corners and one edge v1, v2 and e1, while v1 is an example or The top of class A, and v2 is the top of class B. E1 is an example of Class E. I want to create a schema in the waterline for this relationship and the schema looks like this:

  identity: 'a', connection: 'ex1', attribute: {title: 'string' A: Connection: 'Ex1', attributes: {title: 'string', r: {archive: 'collection of' 'A', via: 'E', via: 'B'}}  

To use this schema, orientdb shows a collection of maps in my areas: in A class 'B' as a Linkset Do I want to relate them only through the edges, is there any way to leave the collection, and just create a relationship that will eliminate E1 level on the edges or map it to the area of ​​these sections as needed?

xeeb, which waterline adapters you are not using for the Orient DB (at least 3) It seems that this is.

In your schema example, you are defining a "many-to-many " associations, but you are not (or shared) Definition of model "through" ().

Finally, the easiest way to create relationships between the top using the edges Depending on your own example, you can do this with the following code snippet:

  // Model A {tableName: 'A', Identity: 'A', Connection: 'Ex1', attributes: Model B {tableName: 'B', identity: 'b', connection: 'ex1' {title: 'string', r: {archive: 'b', via: 'r' Dominant: true}}} attribute: {title: 'string', R: {archive: 'A', through: 'R'}}}  

A complete " Many work from the "Association Working At:

Update: waterline-orientdb is now named sails-orientdb.


No comments:

Post a Comment