typeorm-fixtures icon indicating copy to clipboard operation
typeorm-fixtures copied to clipboard

[Bug] $current not working on array fields

Open CiotkaCierpienia opened this issue 2 years ago β€’ 0 comments

Your Environment

Software Version(s)
typeorm-fixtures 1.0.4
Node 16.14.2
Yarn 1.22.18
Operating System Windows 10

$currnt is not working for arrays of relations, for example:

entity: FirstEntity
items:
   firstEntity{1...10}:
      name: 'FirstEntity($current)" # works

entity: SecondEntity
items:
   secondEntity{1...10}:
      name: 'SecondEntity($current))' # works
      simpleRelation: '@firstEntity($current)' # works
      arrayRelation:
         - '@firstEntity($current)' # does not work, always gives '@firstEntity1'
         - '@firstEntity($current + 1)' # does not work, always gives '@firstEntity2'

It doesn't also get current for the array index of an array field, because it is always 1, even when there is more than one entry in the array.

CiotkaCierpienia avatar May 13 '22 06:05 CiotkaCierpienia