In lithium models, I can use the command()
to select distinct of specific field (See distinct selects in lithium):
$blogs = $self->connection->command(array('distinct'=>'blogs', 'key'=>'url'));
which is translated to mongodb command as:
db.blogs.distinct('url');
Now I want to add a condition on type='rumours' in my distinct query:
db.blogs.distinct('url', {type: 'rumours'});
How do I add this {type: 'rumours'}
condition in command()
?