I have a small base that I created by importing the csv of the document, but after aggregating with my original csv, a number of new fields appeared. How can I import a new document into the database while adding new fields and those documents that are unique by index?
My collection index in collection:
[('date', 1), ('country', 1), ('province/state', 1), unique=True]
Fragment of data located in the database:
_id:601d00ccbf6246e8f0e37460
date:"2021-02-02"
province/state:"AK"
confirmed:52775
probable_cases:NaN
total_test_results:1511785
country:"US"
and many more fields
Data in the collection that I need to get after importing a new csv file (for exaple):
_id:601d00ccbf6246e8f0e37460
date:"2021-02-02"
province/state:"AK"
confirmed:52775
probable_cases:NaN
total_test_results:1511785
country:"US"
vacctination:1234
daily_vaccinations_per_million:NaN
and many more fields
I have not yet found how to do this, but if someone knows, you can say in which direction to move or give an example.
mongoimportcommand-line tool to import the CSV data and Merge matching documents during import.