Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow fields to have arrays of associated items. #3

Merged
merged 1 commit into from

2 participants

@tmeasday

Allow you do do things like

  Meteor.publishWithRelations({
    handle: this,
    collection: Loops,
    mappings: [{
      collection: Profiles,
      key: 'profileIds'
    }]
  }

Where a loop looks like:

{_id: 'abcd', profileIds: ['xcvb', 'cvbb']}
@svasva
Owner

Merging right away. Thanks Tom!

@svasva svasva merged commit 3637357 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. @tmeasday
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  publish_with_relations.coffee
View
2  publish_with_relations.coffee
@@ -20,6 +20,8 @@ Meteor.publishWithRelations = (params) ->
else
objKey = mapping.key
mapFilter._id = obj[mapping.key]
+ if _.isArray(mapFilter._id)
+ mapFilter._id = {$in: mapFilter._id}
_.extend(mapFilter, mapping.filter)
_.extend(mapOptions, mapping.options)
if mapping.mappings
Something went wrong with that request. Please try again.