fuerte icon indicating copy to clipboard operation
fuerte copied to clipboard

/_db/[DBNAME]/ endpoint prefix not recognized by default in fuerte::createRequest

Open lumieria opened this issue 5 years ago • 4 comments

If I specify a particular database in the endpoint for fuerte::createRequest(...) using the leading prefix '/_db/[DBNAME]' before the '/_api/[rest-of-endpoint-subpath]' part, the response to the request will fail, and complain about an unknown path.

The workaround, which I believe should be included inside of the createRequest function by default, is to call request->parseArangoPath() before submitting the request.

Is there some reason this needs to be an extra step, and shouldn't be part of the createRequest function by default?

More details here: https://stackoverflow.com/questions/60364381/how-to-specify-the-database-in-an-arangodb-aql-query

lumieria avatar Feb 29 '20 19:02 lumieria

Idk we do not really use that convenience function in ArangoDB

graetzer avatar Mar 02 '20 07:03 graetzer

This would be a fuerte thing related to accessing Arango's REST api, not an Arango thing per se.
If you don't use that function, how have you been able to refer the API to a database other than '_system' ? Things seem to work fine without it as long as you're only accessing _system, whereas with it you are able to target any existing database. Thanks for any more info if you have it.

lumieria avatar Mar 03 '20 01:03 lumieria

I haven't found anything in the REST api that allows you to set a different "current" database than _system. Am I doing something wrong? I'm just trying to get different databases for different users happening in a C++ app. Thanks!

lumieria avatar Mar 03 '20 01:03 lumieria

Not being an expert on fuerte myself, I think you can set the "database" parameter to direct the request to a specific database: https://github.com/arangodb/fuerte/blob/master/include/fuerte/message.h#L94-L96 Does that solve your problem?

jsteemann avatar Mar 03 '20 08:03 jsteemann