Skip to content

Instantly share code, notes, and snippets.

@ccapndave
Created May 3, 2012 12:32
Show Gist options
  • Select an option

  • Save ccapndave/2585349 to your computer and use it in GitHub Desktop.

Select an option

Save ccapndave/2585349 to your computer and use it in GitHub Desktop.
existingRecords = [ { _id: 1 }, { _id: 2 } ]
requiredRecords = [ { _id: 2 }, { _id: 3 } ]
# I want to find out all the elements of requiredRecords that aren't in existingRecords (there will actually be other properties apart from _id, but I test equality on _id).
=> [ { _id: 3 } ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment