Hi there, anyone already done a CVS import to pre-populate a collection? Thanks in advance #community-help
Hello @Above The Clouds - I've heard of people doing this, there may even be a code example in the discord archive
However, you could create a script to loop over each entry in your CSV and hit the create endpoint for that collection
You could also do it via a migration script in mongodb, but the API route feels easier to me
Thanks @thisisnotchris - do you think it would be a good use case for a plugin?
@Ab
@Above The Clouds It could be if enough people are importing a lot of data!
@Above The Clouds Here's an example script doing an import from csv
https://payloadcms.com/community-help/github/user-csv-import-for-a-collectionStar
Discord
online
Get help straight from the Payload team with an Enterprise License.