def __getitem__(self,key):
        """Lookup by key : return the list of records where
        field value is equal to this key, or an empty list"""
        ids = self.db.indices[self.field].get(key,[])
        return [ self.db.records[_id] for _id in ids ]
Lookup by key : return the list of records where
        field value is equal to this key, or an empty list
recipes/Python/496770_PyDbLite_small_inmemory_database/recipe-496770.py