Created
September 19, 2013 02:12
-
-
Save Albert-IV/6618299 to your computer and use it in GitHub Desktop.
MongoDB Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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