Skip to content

Instantly share code, notes, and snippets.

@Albert-IV
Created September 19, 2013 02:12
Show Gist options
  • Save Albert-IV/6618299 to your computer and use it in GitHub Desktop.
Save Albert-IV/6618299 to your computer and use it in GitHub Desktop.
MongoDB Query
Lead.find( {'$where' : "['fresh', 'new'].indexOf(this.status) > -1"} )
// This runs JavaScript to figure out if the status wasn't "fresh" or "new"
Lead.find( {"status" : { "$nin" : [ "fresh", "new" ] } } )
// Much more performant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment