POST /coll
, PUT /coll/doc
and PATCH /coll/doc
# allow role 'user' access /{username} with read and write filter, cannot use ?filter qparam
- roles:
- user
predicate: path-template[value="/{username}"] and equals[%u, "${username}"]
priority: 100
mongo:
readFilter: '{"status": "public"}'
writeFilter: '{"status": "public"}'
protectedProps: ["status", "user"]
overriddenProps: {"status": '"public"', "user": "@user.userid"}
forbiddenQueryParams: [ "filter" ]
@page the value of the page query parameter
@pagesize the value of the pagesize query parameter
@skip to be used in $skip stage, equals to (page-1)*pagesize
@limit to be used in $limit stage, equals to the value of the pagesize query parameter
is there a way to inject javascript code into the aggregation ? something like:
"stages" : [
{ "$match" : { "timestamp" : { "$gte": "(new Date((new Date()).getTime() - (3 * 24 * 60 * 60 * 1000)))" }}},
{ "$group" : { "_id" : "$hashtag", "count" : { "$sum" : 1 } } },
{ "$sort" : { "count" : -1 } },
{ "$limit": { "$var": "@pagesize" } }
],
"type" : "pipeline",
"uri" : "hashtagslastdays"
}
]
it seems the javascript code in the " is not executed, but without the " it can not be inserted
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_http_version 1.1;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
or this taken from stackoverflow.. but no effect :(
X-Forwarded-For: 80.123.167.xx
X-Real-IP: 80.123.167.xx
X-Forwarded-For