I'm a beginner in CouchDB, and on the net I've read that is possible to run Mango queries with an HTTP request. I've tried hard, but I'm unable to rut queries like this.
This is the command
C:\>curl -X POST http://root:root@127.0.0.1:5984/movielens/_find -d @query.json
{"error":"bad_content_type","reason":"Content-Type must be application/json"}
this is the body of the json file:
{"selector": { "Genres": {"$elemMatch": {"$eq": "Drama"}}}}
From what I understood, I don't know where I'm wrong. So, how do I do to run this query?
You need to set the Content-Type
in your header to application/json
.
Try this:
curl -X POST http://root:root@127.0.0.1:5984/movielens/_find --header 'Content-Type: application/json' -d @query.json