# 7. Query Server

The Query server is an external process that communicates with CouchDB by JSON protocol through stdio interface and processed all design functions calls: views, shows, lists and more.

The default query server is written in JavaScript, running via Mozilla SpiderMonkey. You can use other languages by setting a Query server key in the `language` property of a design document or the Content-Type header of a temporary view. Design documents that do not specify a `language` property are assumed to be of type javascript.

- 7.1. Query Server Protocol
  - 7.1.1. `reset`
  - 7.1.2. `add_lib`
  - 7.1.3. `add_fun`
  - 7.1.4. `map_doc`
  - 7.1.5. `reduce`
  - 7.1.6. `rereduce`
  - 7.1.7. `ddoc`
  - 7.1.8. Returning errors
  - 7.1.9. Logging
- 7.2. JavaScript
  - 7.2.1. Design functions context
  - 7.2.2. CommonJS Modules
- 7.3. Erlang