lucid icon indicating copy to clipboard operation
lucid copied to clipboard

rule exists does not check against each array member

Open tianjos opened this issue 3 years ago • 0 comments

Package version

@adonis/core: 5.8.6

Node.js and npm version

node: 16.17.0 npm: 8.15.0

Sample Code (to reproduce the issue)

schema.create({ users: schema .array([rules.distinct('*'), rules.exists({ table: 'users', column: 'id' })]) .members(schema.number()) })

First, I don't know if I could open the issue here or in lucid repo, but when I try to run exists validation against each array member, it throws database error because it tries to validate against the whole array stringified.

tianjos avatar Sep 23 '22 17:09 tianjos