or:
$doc = array(
'tags' => [
'name=A440',
'highway=secondary',
'oneway=yes'
]
);
$db->poi->ensureIndex( [ 'tags' => 1 ] );
// Road with name=Strand
$db->poi->find( [ 'tags' => 'name=Strand' ] );
// All roads
$db->poi->find( [ 'tags' => new MongoRegex( '/^highway=/' ) ] );
- One index required
- Good for finding key/value combinations
- Good enough for doing the "all roads" question