1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Krishna,
I think the issue is coming from the MongoDB URI in the script. You are trying to use a variable 'collection' in the URI string, but it's not being interpolated correctly. Here's the problematic line:
mongo_uri = "mongodb://<username>:<password>@<hostname>:27017/<databasename>.'collection'"
The 'collection' variable is inside single quotes, which means it's being treated as a literal string, not a variable. To interpolate the variable into the string, you should use f-string formatting in Python. Here's how to fix it:
mongo_uri = f"mongodb://<username>:<password>@<hostname>:27017/<databasename>.{args['collection']}"
This will replace {args['collection']}
with the value of the 'collection' argument passed to the script.
Hope this helps with the issue!
답변함 10달 전
관련 콘텐츠
- AWS 공식업데이트됨 3년 전
the full stacktrace should have more indications of the cause, that error is too generic.