Open lorensr opened 9 years ago
Well you definitely can't have 2 foreign_key
lol. I think you might have misunderstood the way you use it. The correct way is foreign_key:"users"
and you're done.
Right, that's what you do when the schema has users
, but it would be nice if the schema didn't need the users
array, and the package was modified to work w/ 2 foreign_key
s or 2 key
s.
Ah, I get it now, lol. That might not be too difficult to patch in but performance could be affected since you would end up querying per key vs a single array query.
Okay, so it would just be in effect doing this:
mappings: [
foreign_key: 'from'
collection: Meteor.users
,
foreign_key: 'to'
collection: Meteor.users
]
(which works currently)
And doing that is not performant as using an array.
Using an array will increase performance for sure but both will perform well.
I currently can't do a mapping with two keys, eg
you have to duplicate the uids into an array, eg:
Perhaps this is because having multiple fields would not be performant compared to a single array field, in which case I withdraw the FR :)