nickva commented on a change in pull request #622:
URL:
https://github.com/apache/couchdb-documentation/pull/622#discussion_r571143375
##########
File path: src/ddocs/views/intro.rst
##########
@@ -87,10 +87,18 @@ familiar with JavaScript but have used C or any other
C-like language such as
Java, PHP, or C#, this should look familiar. It is a simple function
definition.
You provide CouchDB with view functions as strings stored inside the ``views``
-field of a design document. You don’t run it yourself. Instead, when you
+field of a design document. To create this view you can use this command:
+
Review comment:
It might be better to use a code block here. As in:
```
.. code-block:: text
$ curl -X PUT http://admin:[email protected]:5984/db/_design/my_ddoc
\
-d '{"views":{"my_filter":{"map":
"function(doc) { if(doc.date && doc.title) { emit(doc.date,
doc.title); }}"}}}'
```
So it renders just like to other examples in the page
##########
File path: src/ddocs/views/intro.rst
##########
@@ -87,10 +87,18 @@ familiar with JavaScript but have used C or any other
C-like language such as
Java, PHP, or C#, this should look familiar. It is a simple function
definition.
You provide CouchDB with view functions as strings stored inside the ``views``
-field of a design document. You don’t run it yourself. Instead, when you
+field of a design document. To create this view you can use this command:
+
+ curl -X PUT http://admin:[email protected]:5984/db/_design/my_ddoc \
+ -d '{"views":{"my_filter":{"map":
+ "function(doc) { if(doc.date && doc.title) { emit(doc.date,
doc.title); }}"}}}'
+
+You don’t run the JavaScript function yourself. Instead, when you
`query your view`, CouchDB takes the source code and runs it for you on every
document in the database your view was defined in. You `query your view` to
-retrieve the `view result`.
+retrieve the `view result` using the following command:
+
+ curl -X GET
http://admin:[email protected]:5984/db/_design/my_ddoc/_view/my_filter
Review comment:
Let's use a `.. code-block:: text` here as well. See some javascript
code-block sections on the syntax
##########
File path: src/maintenance/compaction.rst
##########
@@ -111,7 +111,7 @@ information about it via :ref:`database information
resource <api/db>`::
"update_seq": 76215
}
-Note that ``compaction_running`` field is ``true`` indicating that compaction
+Note that ``compact_running`` field is ``true`` indicating that compaction
Review comment:
Good find!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]