Welcome to the community @Sandeep_N_A 
Is there some documentation about calling the $search function via POST since Retool supports RESTful as a method to pull data for my webapp.
The Atlas Search queries take the form of an aggregation pipeline stage. You will be need to use the POST /action/aggregate
endpoint for the Atlas Data API for $search
queries. The following Run an Aggregation Pipeline documentation may help you this although the example on the page does not have a $search
stage used as part of the pipeline. However, please see the below example I’ve used against a test system which includes the $search
stage:
curl --location --request POST 'https://data.mongodb-api.com/app/data-hkzxc/endpoint/data/beta/action/aggregate' \
--header 'Content-Type: application/json' \
--header 'Access-Control-Request-Headers: *' \
--header 'api-key: API_KEY_REDACTED' \
--data-raw '{
"collection":"namecoll",
"database":"namedb",
"dataSource":"M10Cluster",
"pipeline": [
{
"$search": {
"index": "namecollsearchindex",
"text": {
"query": "Test",
"path": {
"wildcard": "*"
}
}
}
}
]
}'
Response:
{"documents":[
{"_id":"62730ee3d51e21ac65d9db06","name":"Test Name"},
{"_id":"62730f31d51e21ac65d9db0a","name":"John Test"}
]}
Currently, I am using the DATA API provided by atlas but I can only use ‘filter’ and ‘projection’ params to get results.
As shown in the above example, you’ll need to use the pipeline
parameter in the request body.
The Atlas Data API is currently in preview so there are chances the above behaviour may change.
I hope the above helps.
Regards,
Jason