0

Good Afternoon,

I am new with node.js and I try to develope an only command app.

For this app I need an ORM and I wish to use WATERLINE as standalone but not in express framework.

I looked at the example and I succeed to see my different collections.

// Our collections (i.e. models):
ontology.collections;
console.log(ontology.collections);
// Our connections (i.e. databases):
ontology.connections;

I am stucked after this. I can't find a way to return my models and make queries.

If someone could help me taht would be great.

Thanks

Travis Webb
  • 14,688
  • 7
  • 55
  • 109

1 Answers1

0

If you initialized Waterline in the ontology variable and got the collections successfully loaded as you say, now you can access each collection loaded (with loadCollection()) like this:

ontology.collection.mycollection

Where mycollection is the identity defined in your model.

Then you can make queries:

ontology.collection.mycollection.find(...)
Jesús Carrera
  • 11,275
  • 4
  • 63
  • 55