Created
November 5, 2010 16:37
-
-
Save ssx/664411 to your computer and use it in GitHub Desktop.
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
<? | |
$m = new Mongo(); | |
$h = $m->user->users; | |
$artist = "Linkin Park"; | |
// lastfm_band_0, lastfm_band_1 or lastfm_band_2 may contain $artist | |
// I need to get the number of documents where this is the case | |
$x = $h->find(array("lastfm_band_0" => $artist, | |
'$or' => array( | |
array("lastfm_band_1" => $artist), | |
array("lastfm_band_2" => $artist) | |
)) | |
)->count(); | |
echo var_dump($x); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment