ARTICLE AD BOX
Given Fluent's example of an OptionalParent relationship:
final class Planet: Model { // Example of an optional parent relation. @OptionalParent(key: "star_id") var star: Star? }How do I query for planets with no star parent? I tried this but it doesn't work:
let wanderers = try await Planet.query(on: myDb) .filter(\.$star.id == nil) //error: Cannot infer key path type from context; consider explicitly specifying a root typeI also tried .filter(\.$star == nil) and got a longer error about not being able to apply == to these operands.
