diff --git a/explainshell/store.py b/explainshell/store.py index 6cadaf0b..cf0cf569 100644 --- a/explainshell/store.py +++ b/explainshell/store.py @@ -356,7 +356,7 @@ def updatemanpage(self, m): logger.info('updating manpage %s', m.source) m.updated = True self.manpage.update({'source' : m.source}, m.to_store()) - _id = self.manpage.find_one({'source' : m.source}, fields={'_id':1})['_id'] + _id = self.manpage.find_one({'source' : m.source}, projection=['_id'])['_id'] for alias, score in m.aliases: if alias not in self: self.addmapping(alias, _id, score) @@ -369,7 +369,7 @@ def verify(self): # check that everything in manpage is reachable mappings = list(self.mapping.find()) reachable = set([m['dst'] for m in mappings]) - manpages = set([m['_id'] for m in self.manpage.find(fields={'_id':1})]) + manpages = set([m['_id'] for m in self.manpage.find(projection=['_id'])]) ok = True unreachable = manpages - reachable @@ -386,12 +386,12 @@ def verify(self): return ok, unreachable, notfound def names(self): - cursor = self.manpage.find(fields={'name':1}) + cursor = self.manpage.find(projection=['_id', 'name']) for d in cursor: yield d['_id'], d['name'] def mappings(self): - cursor = self.mapping.find(fields={'src':1}) + cursor = self.mapping.find(projection=['_id,', 'src']) for d in cursor: yield d['src'], d['_id']