Created
July 20, 2012 17:49
-
-
Save darkredz/3152203 to your computer and use it in GitHub Desktop.
JS expression query in MongoDB with DooPHP
This file contains hidden or 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
| <?php | |
| //this would be slow to find case insensitive category | |
| $categoryInput = strtolower($postedFromSomeWhere); | |
| $categoryModel = new Category; | |
| $rs = $categoryModel->findOne( | |
| '$where' => 'this.category.toLowerCase()=="'. $categoryInput .'" && this.username=="leng"' | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment