Created
August 27, 2020 07:31
-
-
Save lakshay-arora/7a86d0bafe8b43d51e0dfcfd02b6f80a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create weekly demand collection | |
database.create_collection("weekly_demand") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get collection weekly_demand | |
weekly_demand_collection = database.get_collection("weekly_demand") | |
# open the weekly_demand json file | |
with open("weekly_demand.json") as f: | |
file_data = json.load(f) | |
# insert the data into the collection | |
weekly_demand_collection.insert_many(file_data) | |
# get the count of total data points | |
weekly_demand_collection.find().count() | |
# >> 456548 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment