You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by dj...@apache.org on 2013/05/18 15:02:32 UTC
[1/3] git commit: updated refs/heads/1.3.x to fe56a84
Updated Branches:
refs/heads/1.3.x 24b1e8a49 -> fe56a84c3
docs: improve language in Erlang query server section.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e4cfc402
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e4cfc402
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e4cfc402
Branch: refs/heads/1.3.x
Commit: e4cfc4023b0c96ae9ebad27b293df045b7f86964
Parents: 24b1e8a
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Sat May 18 14:41:52 2013 +0200
Committer: Dirkjan Ochtman <dj...@apache.org>
Committed: Sat May 18 14:41:52 2013 +0200
----------------------------------------------------------------------
share/doc/src/query-servers.rst | 42 +++++++++++++++------------------
1 files changed, 19 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/e4cfc402/share/doc/src/query-servers.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/query-servers.rst b/share/doc/src/query-servers.rst
index e77abd7..a5b7895 100644
--- a/share/doc/src/query-servers.rst
+++ b/share/doc/src/query-servers.rst
@@ -339,19 +339,17 @@ Erlang
.. warning::
- Erlang query server runs out of sandbox feature like JavaScript has to!
- This means, that Erlang code has full access to your OS, file system and
- network which may leads to security issues. While Erlang functions are
- faster than JavaScript ones, you need to be careful with running them,
- especially if they wasn't written by your own hands.
-
- Keep in mind: don't trust every code - review it first before running.
+ Unlike the JavaScript query server, the Erlang query server does not
+ run in a sandbox. This means Erlang code has full access to your OS,
+ filesystem and network, which may lead to security issues. While Erlang
+ functions are faster than JavaScript ones, you need to be careful
+ about running them, especially if they were written by someone else.
.. note::
- Due to security restriction, Erlang query server is disabled by default.
- To enable it you'll need to edit your `local.ini` to include a
+ Due to security restrictions, the Erlang query server is disabled by
+ default. To enable it, you need to edit your `local.ini` to include a
``native_query_servers`` section:
.. code-block:: ini
@@ -359,13 +357,13 @@ Erlang
[native_query_servers]
erlang = {couch_native_process, start_link, []}
- And don't forget to restart CouchDB after that and use ``language: "erlang"``
- property in your Erlang design documents.
+ Don't forget to restart CouchDB after updating the configuration, and
+ use the ``language: "erlang"`` property in your Erlang design documents.
.. function:: Emit(Id, Value)
- Emits `key`-`value` pair to view indexer process.
+ Emits `key`-`value` pairs to view indexer process.
.. code-block:: erlang
@@ -378,10 +376,10 @@ Erlang
.. function:: FoldRows(Fun, Acc)
- Helper to iterate over all rows in list function.
+ Helper to iterate over all rows in a list function.
:param Fun: Function object.
- :param Acc: Previous returned value by `Fun`.
+ :param Acc: The value previously returned by `Fun`.
.. code-block:: erlang
@@ -399,7 +397,7 @@ Erlang
.. function:: GetRow()
- Retrieves next row from related view result.
+ Retrieves the next row from a related view result.
.. code-block:: erlang
@@ -421,7 +419,7 @@ Erlang
.. function:: Log(Msg)
- :param Msg: Message to log in at CouchDB `INFO` level.
+ :param Msg: Log a message at the `INFO` level.
.. code-block:: erlang
@@ -432,8 +430,8 @@ Erlang
Emit(<<K>>, V)
end.
- On map function run in CouchDB logs (e.g. at `/var/log/couchdb/couch.log`)
- you may find next record:
+ After the map function has run, the following line can be found in
+ CouchDB logs (e.g. at `/var/log/couchdb/couch.log`):
.. code-block:: text
@@ -453,7 +451,7 @@ Erlang
"!"
end.
- Function above produces next response:
+ The function above produces the following response:
.. code-block:: text
@@ -464,8 +462,8 @@ Erlang
:param Headers: Proplist of :ref:`response object<response_object>`.
- Initialize :ref:`listfun` response. At this point response code and headers
- may be defined. For example, next function redirect to CouchDB web site:
+ Initialize :ref:`listfun` response. At this point, response code and headers
+ may be defined. For example, this function redirects to the CouchDB web site:
.. code-block:: erlang
@@ -477,5 +475,3 @@ Erlang
]}),
"Relax!"
end.
-
-
[3/3] git commit: updated refs/heads/1.3.x to fe56a84
Posted by dj...@apache.org.
docs: improve language, consistency in CommonJS section
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/fe56a84c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/fe56a84c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/fe56a84c
Branch: refs/heads/1.3.x
Commit: fe56a84c36d229dcc2d8c776cffdbf21d8e59608
Parents: c1476e9
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Sat May 18 15:01:03 2013 +0200
Committer: Dirkjan Ochtman <dj...@apache.org>
Committed: Sat May 18 15:01:03 2013 +0200
----------------------------------------------------------------------
share/doc/src/query-servers.rst | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/fe56a84c/share/doc/src/query-servers.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/query-servers.rst b/share/doc/src/query-servers.rst
index c0fcb08..64f9bfb 100644
--- a/share/doc/src/query-servers.rst
+++ b/share/doc/src/query-servers.rst
@@ -241,11 +241,11 @@ modules and functions:
CommonJS Modules
----------------
-`CommonJS Modules <http://wiki.commonjs.org/wiki/Modules/1.1.1>`_ is the one of
-major CouchDB feature introduced in 0.11.0 version that allows to create modular
-design functions without needs to duplicate a lot of same functionality.
+Support for `CommonJS Modules <http://wiki.commonjs.org/wiki/Modules/1.1.1>`_
+(introduced in CouchDB 0.11.0) allows you to create modular design functions
+without the need for duplication of functionality.
-Example of CommonJS module that checks user permissions:
+Here's a CommonJS module that checks user permissions:
.. code-block:: javascript
@@ -310,17 +310,17 @@ Example of CommonJS module that checks user permissions:
Each module has access to additional global variables:
-- **module** (`object`): Contains information about stored module.
+- **module** (`object`): Contains information about the stored module
- - **id** (`string`): Module id that is actually JSON path in ddoc context.
- - **current** (`code`): Compiled module code object.
- - **parent** (`object`): Parent frame.
- - **exports** (`object`): Export statements.
+ - **id** (`string`): The module id; a JSON path in ddoc context
+ - **current** (`code`): Compiled module code object
+ - **parent** (`object`): Parent frame
+ - **exports** (`object`): Export statements
-- **exports** (`object`): Shortcut to ``module.exports`` object.
+- **exports** (`object`): Shortcut to the ``module.exports`` object
-Lets place module above within design document under `lib/validate` path.
-Now we could use it in our design functions:
+This module can be used after adding it to the design document, for example,
+under the `lib/validate` path. We may then use it in our view functions:
.. code-block:: javascript
[2/3] git commit: updated refs/heads/1.3.x to fe56a84
Posted by dj...@apache.org.
docs: improve language, consistency in JS query server section
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c1476e95
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c1476e95
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c1476e95
Branch: refs/heads/1.3.x
Commit: c1476e95dd1bccf8ce6ef57e6f0eb8cb88169c79
Parents: e4cfc40
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Sat May 18 14:56:05 2013 +0200
Committer: Dirkjan Ochtman <dj...@apache.org>
Committed: Sat May 18 14:56:05 2013 +0200
----------------------------------------------------------------------
share/doc/src/query-servers.rst | 57 ++++++++++++++++++----------------
1 files changed, 30 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/c1476e95/share/doc/src/query-servers.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/query-servers.rst b/share/doc/src/query-servers.rst
index a5b7895..c0fcb08 100644
--- a/share/doc/src/query-servers.rst
+++ b/share/doc/src/query-servers.rst
@@ -42,7 +42,7 @@ JavaScript
+--------------------------------+---------------------------------------------+
| :func:`registerType` | :ref:`showfun`, :ref:`listfun` |
+--------------------------------+---------------------------------------------+
-| :func:`require` | every except :ref:`reducefun` |
+| :func:`require` | any, except :ref:`reducefun` |
+--------------------------------+---------------------------------------------+
| :func:`send` | :ref:`listfun` |
+--------------------------------+---------------------------------------------+
@@ -56,17 +56,17 @@ JavaScript
Design functions context
------------------------
-Each design function executes within special context of predefined objects,
+Each design function executes in a special context of predefined objects,
modules and functions:
.. function:: emit(key, value)
- Puts `key`-`value` pair into inner stack for further passing to CouchDB
- when map function is done.
+ Emits a `key`-`value` pair for further processing by CouchDB after the map
+ function is done.
- :param key: View's key.
- :param value: Associated value with `key`.
+ :param key: The view key
+ :param value: The `key`'s associated value
.. code-block:: javascript
@@ -77,7 +77,7 @@ modules and functions:
.. function:: getRow()
- Extracts next row from the related view result.
+ Extracts the next row from a related view result.
:return: View result row
:rtype: object
@@ -106,16 +106,18 @@ modules and functions:
.. function:: isArray(obj)
- Helper to check is provided value `array` or not
+ A helper function to check if the provided value is an `Array`.
:param obj: Any Javascript value
- :return: ``true`` is `obj` is `array` typed, ``false`` otherwise.
+ :return: ``true`` if `obj` is `Array`-typed, ``false`` otherwise
:rtype: boolean
.. function:: log(message)
- :param message: Message to log in at CouchDB `INFO` level.
+ Log a message to the CouchDB log (at the `INFO` level).
+
+ :param message: Message to be logged
.. code-block:: javascript
@@ -124,8 +126,8 @@ modules and functions:
emit(doc['_id'], null);
}
- On map function run in CouchDB logs (e.g. at `/var/log/couchdb/couch.log`)
- you may find next record:
+ After the map function has run, the following line can be found in CouchDB
+ logs (e.g. at `/var/log/couchdb/couch.log`):
.. code-block:: text
@@ -137,7 +139,7 @@ modules and functions:
Registers callable handler for specified MIME key.
:param key: MIME key previously defined by :func:`registerType`
- :param func: MIME type handler.
+ :param func: MIME type handler
.. function:: registerType(key, *mimes)
@@ -145,7 +147,7 @@ modules and functions:
Registers list of MIME types by associated `key`.
:param key: MIME types
- :param mimes: MIME types enumeration.
+ :param mimes: MIME types enumeration
Predefined mappings (`key`-`array`):
@@ -169,10 +171,11 @@ modules and functions:
.. function:: require(path)
- Loads CommonJS module by specified `path`. Path shouldn't starts with slash.
+ Loads CommonJS module by a specified `path`. The path should not start with
+ a slash.
- :param path: CommonJS module path started from design document root.
- :return: Exported statements.
+ :param path: A CommonJS module path started from design document root
+ :return: Exported statements
.. function:: send(chunk)
@@ -193,16 +196,16 @@ modules and functions:
.. function:: start(init_resp)
- Initiates chunked response. As an option, custom
+ Initiates chunked response. As an option, a custom
:ref:`response <response_object>` object may be sent at this point.
For `list`-functions only!
.. note::
- Only at this point list functions may set response `HTTP code` and
- `headers`. Also, you need to run this function before :func:`send`,
- :func:`getRow` or `return` statement or query server will implicitly call
- this function with empty object (``{}``).
+ list functions may set the `HTTP response code` and `headers` by calling
+ this function. This function must be called before :func:`send`,
+ :func:`getRow` or a `return` statement; otherwise, the query server will
+ implicitly call this function with the empty object (``{}``).
.. code-block:: javascript
@@ -219,19 +222,19 @@ modules and functions:
.. function:: sum(arr)
- Summarize `arr` items.
+ Sum `arr`'s items.
- :param arr: Array of numbers.
+ :param arr: Array of numbers
:rtype: number
.. function:: toJSON(obj)
- Encodes `obj` to JSON string. Actually is a proxy to ``JSON.stringify``
+ Encodes `obj` to JSON string. This is an alias for the ``JSON.stringify``
method.
- :param obj: JSON encodable object.
- :return: JSON string.
+ :param obj: JSON encodable object
+ :return: JSON string