I have a large array of object that I get from an API, this is its URL: https://api.opensea.io/api/v1/asset_contracts/ I would like to take this JSON and pass it to MongoDB in a way that will create a record for each object in this array (currently there are ~230).
What will be the best way to do it? I currently have the json like so:
fetch("https://api.opensea.io/api/v1/asset_contrcts/"}).then(r => r.json())
.then(data => {
// Add all of the data to a collection;
return data;
});
}
What is the best way to do so? Run in a for loop over each of the objects and insert it or is there some way to do it in a more optimal way?