title: Is the order of the entities returned from `Repository#save([array])` guaranteed?
body: <p>In TypeORM, if we have a repository called <code>repo</code>, we can call <code>repo.save([entity1, entity2])</code> to save new entities and/or update existing ones. <code>Repository#save</code> also returns an array of the saved entities.</p>
  <p>Is the order of the returned entities guaranteed to match the order that was passed in?</p>
  <p>For example, if I call <code>repo.save([newEntity1, newEntity2, newEntity3])</code> (where each is a new entity without an ID), will I <em>always</em> get back <code>[entity1, entity2, entity3]</code>, where each element in the output array corresponds to the respective element in the input array, but with an assigned ID?</p>
  <p>In my testing, the order seems to match, but I want to be sure that it's guaranteed.</p>
  <hr />
  <p><code>Repository</code> documentation: <a href="https://typeorm.io/#/repository-api" rel="nofollow noreferrer">https://typeorm.io/#/repository-api</a></p>
  <p>Relevant passage:</p>
  <blockquote>
  <p><code>save</code> - Saves a given entity or array of entities. If the entity already exist in the database, it is updated. If the entity does not exist in the database, it is inserted. It saves all given entities in a single transaction (in the case of entity, manager is not transactional). Also supports partial updating since all undefined properties are skipped. Returns the saved entity/entities.</p>
  </blockquote>
  <p>It's not clear what guarantees this provides about the order.</p>