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ヶ月前
関連するコンテンツ
- 質問済み 9ヶ月前
- AWS公式更新しました 2年前
- AWS公式更新しました 3年前
the full stacktrace should have more indications of the cause, that error is too generic.