A method I often use for client-side joins of two collections is transform.
This is best explained with an example, where the collection Activities gets attributes from the collection libraryItems with the key libraryitem:
export default createContainer(() => {
let activitiesSub = Meteor.subscribe('allActivities');
let libraryItemsSub = Meteor.subscribe('allLibraryItems');
var activities = Activities.find({}, {
transform: function (doc) {
doc.libraryitem = LibraryItems.findOne({
_id: doc.libraryItemId
});
return doc;
}
}).fetch();
return {
activities: activities,
}
}, App);
This works perfect for me in Meteor React, but the transform method does not work in react-native-meteor. What is the best alternative for client-side-joins here?
A method I often use for client-side joins of two collections is
transform
. This is best explained with an example, where the collectionActivities
gets attributes from the collectionlibraryItems
with the keylibraryitem
:This works perfect for me in Meteor React, but the
transform
method does not work inreact-native-meteor
. What is the best alternative for client-side-joins here?