balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

enableExperimentalDeepTargets on CURL queries #7241

Open cecchigl opened 2 years ago

cecchigl commented 2 years ago

The documentation totally lack on information about this parameter or at least i was not able to find it out. is it possible to add this param to a CURL query ?

I'm trying to retireve the resource querying a nested parameter in this way /resource?where={"field.token":"<somestring>"}

and i get the following

{
    "code": "E_INVALID_CRITERIA",
    "details": "Could not use the provided `where` clause.  Could not filter by `field.token`: Cannot use dot notation in a constraint target without enabling experimental support for \"deep targets\".  Please try again with `.meta({enableExperimentalDeepTargets:true})`.",
    "message": "The server could not fulfill this request (`GET /resource`) due to a problem with the parameters that were sent.  See the `details` for more info."
}

But it gives no information on how to add the parameter inside an external curl query

sailsbot commented 2 years ago

@cecchigl Thanks for posting! We'll take a look as soon as possible.

In the mean time, there are a few ways you can help speed things along:

Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.

For help with questions about Sails, click here.

mikermcneil commented 2 years ago

Hi @cecchigl, I would recommend writing your own custom action.

But what you are trying to do is possible with: https://sailsjs.com/documentation/reference/configuration/sails-config-blueprints#?using-parseblueprintoptions.

Here's the docs for the Find blueprint: https://sailsjs.com/documentation/reference/blueprint-api/find-where

mikermcneil commented 2 years ago

i.e. I think sticking meta: {enableExperimentalDeepTargets: true} on the query options you return from that function should do the trick.