Therefore, the posts relations is saved on cache and you can load posts with
Without any addtionnal request. If the relation is not in cache, if additionnal conditions are added, it has the same behaviour than now.
Therefore allowing to add more complex conditions
--
The official community of RailwayJS
website: railwayjs.com,
source: https://github.com/1602/express-on-railway,
---
You received this message because you are subscribed to the Google Groups "RailwayJS" group.
To post to this group, send email to rail...@googlegroups.com.
Visit this group at http://groups.google.com/group/railwayjs?hl=en.
var reviewsAr = [];
pub.reviews({order: 'reviewdate DESC'}, function(err, reviews){
if (!reviews.length) {
cb(reviewsAr);
}
for (i in reviews) {
var countDone = 0;
var review = reviews[i];
review.filesArray = [];
reviewsAr.push(review);
review.files(function(err, files){
this.filesArray = files;
countDone++;
if (countDone == reviews.length) {
cb(reviewsAr);
}
}.bind(review));
}
});
ok I am now back to the include function, but I am facing an issue. Since most adapters are now separated from the core, I don't know where to put tests which work on several adapters but not all (I see those tests are now commented in the core, is it still under consideration ?).
Thanks!
--
The official community of RailwayJS
website: railwayjs.com,
source: https://github.com/1602/express-on-railway,
---
You received this message because you are subscribed to the Google Groups "RailwayJS" group.
To post to this group, send email to rail...@googlegroups.com.
Visit this group at http://groups.google.com/group/railwayjs?hl=en.
The official community of CompoundJS.
website: compoundjs.com
source: https://github.com/1602/compound
bug reports: https://github.com/1602/compound/issues?state=open
---
You received this message because you are subscribed to a topic in the Google Groups "CompoundJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/compoundjs/YxcIOKEqM8w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to compoundjs+...@googlegroups.com.
To post to this group, send email to compo...@googlegroups.com.
Visit this group at http://groups.google.com/group/compoundjs.
For more options, visit https://groups.google.com/d/optout.
Thanks Drouyer,
Pls find my code below.
var Category = schemaPost.define('Category', EventStructure.CategoryStructure, {restPath: '/category' });
var SubCategory = schemaPost.define('SubCategory', EventStructure.SubCategoryStructure, { restPath: '/subcategory'});
SubCategory.belongsTo(Category, {as: 'cat', foreignKey: 'CategoryId'});
Category.hasMany(SubCategory, {as: 'subcat', foreignKey: 'CategoryId'});
var category = new Category;
var subcategory = new SubCategory;
category.subcat.build;
but when I do Category.all({include:['subcat']}, function(err, category) {
I am only getting the category information what I want is an inner join with both the tables and for the info from both the tables to be displayed
How to I achieve that?
Regards
Abhishek