Api does not return a record of my dataset with a parameter that is inside a column

Hi, I’m new to using this platform and I’m trying to create an api that receives an id parameter, which in my schema is inside another column, but it always returns empty, the structure would be something like this:
[
{
“row”: 1,
“datosCliente”: {
“id”: “6677589595”,
“name”: “…”,
},
{
“row”: 2,
“datosCliente”: {
“id”: “6…”,
“name”: “…”,
}
]
and I am structuring my request in the api like this:

from_dataset(“Clientes”, criteria: { datosCliente[“id”]: params[‘id’] } )

but it always returns empty, and just to test I tried it with the value of “row” and it works for me, but that case doesn’t work for me, what I want is to search by the id that is inside “datosCliente”

Use this code snippet instead:

clientes = from_dataset("Clientes")
datos_id = params["id"].to_i
filter_clientes = clientes.select do |cliente|
  cliente if cliente["datosCliente"]["id"] == datos_id
end
filter_clientes

I’m not good in ruby, so I can’t write a break statement after the code finds the first occurrence of the datosCliente[‘id’]. But this should work