Skip to content

Commit

Permalink
Fix pymongo index (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
kchojn authored Oct 12, 2021
1 parent 25164c2 commit fd11c70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ethtx/providers/semantic_providers/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from typing import Dict, Optional

import bson
from pymongo import TEXT
from pymongo.cursor import Cursor
from pymongo.database import Database as MongoDatabase
from pymongo.errors import OperationFailure
Expand Down Expand Up @@ -110,9 +111,9 @@ def _init_collections(self) -> None:
if mongo_collection == "signatures":
try:
self._signatures.create_index(
[("signature_hash", "TEXT"), ("name", "TEXT")],
[("signature_hash", TEXT), ("name", TEXT)],
background=True,
unique=True,
unique=False,
)
except OperationFailure as e:
log.warning(e)

0 comments on commit fd11c70

Please sign in to comment.