IETF The HTTP Query Method ( Draft)

I come across this IETF draft. The HTTP QUERY Method

It’s about proposing a new method called Query to HTTP protocol.

From looks of it it appears that this Query method would support the SQL queries out of the box.

If this become a standard how would it affect MongoDB usage?

Hello @max, the QUERY verb is meant to be (from the IETF link you had provided):

This specification defines a new HTTP method, QUERY, as a safe, idempotent request method that can carry request content.

And,

The body payload of the request defines the query.

This payload is not limited SQL or any specific kind of syntax. So, it can be used with applications using any kind of database search requests - elaborate ones. You just use the payload details to form your query in the actual search program. So, the payload can be of any form which can be used to form the database query.

Having a payload is an advantage of the QUERY over the GET verb (which doesn’t have the payload option and you send the query parameters).

The memo used SQL as an example only. Yes, it is possible to send MongoDB queries as requests using the QUERY method. How it can be used, the syntax and details are to be determined by use case, specific preferences and some other details.

The example, uses the following as the QUERY request’s payload:

select surname, givenname, email limit 10

In your application you will have to transform it to actual SQL syntax and query specific table. I guess it is something similar with the MongoDB query too - as the payload is specifying (in this example) the projection and limit.

4 Likes

Thank you for making it easier to understand.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.