Replies: 1 comment 1 reply
-
Hey @dacgray — do you have versions / drafts enabled on these collections? You need to also restore the corresponding versions collection if so. If that's not it, then you might need to create ObjectIds out of the Once your documents are stored in your DB, you need to make sure that the Give that a shot! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to reproduction
No response
Describe the Bug
We want to generate dev seed data from our production database. We need to remove sensitive data, so in prod we iterate through our collections and generate safe seed JSON files.
EG:
users.json
In dev we run a migration that populates the DB with these files using mongo insertMany().
The problem is that we can't fetch models by their ID.
We can get data with
payload.find()
, and in the UI we can see the collection list view, but we get "Nothing Found" in the model view.We can fetch models by ID using the mongo client:
But not with payload:
Our collections' schema are rather complex, which is why we want to generate dev seed data from prod. We need to maintain relationships between collections, so we need to populate the dev DB with IDs.
I would very much like to avoid creating an ID field on all collections just for this.
Are we missing a step?
To Reproduce
As above
Payload Version
2.19.3
Adapters and Plugins
"@payloadcms/bundler-webpack": "^1.0.6", "@payloadcms/db-mongodb": "^1.3.2", "@payloadcms/plugin-cloud-storage": "^1.1.1", "@payloadcms/plugin-sentry": "^0.0.6", "@payloadcms/richtext-slate": "^1.3.1",
Beta Was this translation helpful? Give feedback.
All reactions