-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intersection on Array of Objects #926
Comments
You can customize the matching of values by customizing var objects = [{ 'a': 1 }, { 'a': 2 }],
other = [{ 'a': 2 }, { 'a': 3 }];
var _ = require('lodash').runInContext();
_.indexOf = _.findIndex;
_.intersection(objects, other);
// => [{ 'a': 2 }] |
Hi. I would like to do intersection based on a particular property in the object. For example, id in the below example. var objects = [{ 'id': 1,data:[{...}] }, { 'id': 2,data:[{...}] }],
other = [{ 'id': 2 ,data:[{...}] }, { 'id': 3,data:[{...}] }]; The intersection of the above two objects based on id should be |
@vigneshnrfs |
For people who would end up here after Googling, please read this Stack Overflow answer. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is it possible to include the intersection on array of objects as a method in the library itself?
The text was updated successfully, but these errors were encountered: