Skip to content

Commit

Permalink
Changed Query Limit
Browse files Browse the repository at this point in the history
  • Loading branch information
shahsad-kp committed Jun 15, 2021
1 parent e57c6bc commit 70c82d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions InlineBot/database/filterbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ async def get_filters(text):
documents = filter_collection.find()
doc_list = list(documents)
doc_list.reverse()
return doc_list[:20]
return doc_list[:50]
else:
regex = f"^{text}.*"
query = {'text': {'$regex' : regex}}
documents = filter_collection.find(query).sort('text', 1).limit(20)
documents = filter_collection.find(query).sort('text', 1).limit(50)
return documents

async def get_alerts(id):
Expand Down

0 comments on commit 70c82d5

Please sign in to comment.