When using createManyAndReturn, am I guaranteed the results order to be the same as of the input?
When using createManyAndReturn, am I guaranteed the results order to be the same as of the input?
3 Replies
Hey 👋
no, because databases do not explicitly guarantee that themselves. The order of the returned data from createManyAndReturn() is not guaranteed to match the order of the input data.
You would need to use orderBy to get a guaranteed order
ok, thanks!
No worries! 🙂