Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のpythonコードには、現在の日付をmongodbデータベースのフィールドにUTC形式で保存する次の行があります。
s['metadata']['some_date'] = datetime.utcnow()
しかし、プログラムを実行すると、次のエラーが発生します。
TypeError: 'unicode' オブジェクトは項目の割り当てをサポートしていません
コードの何が問題で、どのように修正すればよいですか?
助けてください ありがとう
's' または s['metadata'] は文字列ですが、dict ではありません....pdb はあなたの友達です。