0
Comment puis-je ajouter des clauses au générateur de requêtes Fluents à l'intérieur d'une boucle? Je veux juste faire une boucle dans un tableau de dictionnaire et ajouter les prédicats selon le contenu du dictionnaire. Par exemple, pour ce tableau:Ajout de groupes AND imbriqués dans un groupe OR à partir d'un tableau de dictionnaire dans Fluent (Swift)
var data: [[String: String]] = [
[
"name": "Joe",
"email": "[email protected]"
],
[
"name": "John",
"email": "[email protected]"
]
]
je voudrais produire cette requête:
var contacts = try Contact.makeQuery().or { orGroup in
try orGroup.and { andGroup in
try andGroup.filter("name", "Joe")
try andGroup.filter("email", "[email protected]")
}
try orGroup.and { andGroup in
try andGroup.filter("name", "John")
try andGroup.filter("email", "[email protected]")
}
}.all()
Merci.