New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createMany dosen't insert realation #15340
Comments
These will need to be an array of ids that already exist or you will need to loop through and create them beforehand and grab the IDs. We don't support creating nested data at any level. |
Hello @MHZarei, First thank you for reporting this feature need. In your message, please mention the URL of this thread in case some messages are posted there. But the most important is to have your feedback posted on our feedback/roadmap site. In order to keep our GitHub issues clean and for valid bug reports this issue will be marked as closed, but please feel free to continue the discussion with other community members here. Thank you for your insight and have a good day. |
@derrickmehaffy |
To prove it, try to create a content type named await strapi.db.query('api::post.post').createMany({
data: [{ author: 1 }],
}); It doesn't save the author field even if user 1 does exist. |
why is it closed? problem is still exist? |
Bug report
Required System information
Describe the bug
If your entity have relation with another entity, and on createMany use id of it to insert, it doesn't insert relation data!
For example this code just insert rate and date and the user information doesn't inserted.
Expected behavior
I expected the relation information (for above example: user) saved in the database;
The text was updated successfully, but these errors were encountered: