dirkmb commented on a change in pull request #622:
URL:
https://github.com/apache/couchdb-documentation/pull/622#discussion_r571183553
##########
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:
done. I did not put in the `$`. Is there a default this?
My grep showed that's sometimes with $ sometimes without.
##########
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:
done as well
----------------------------------------------------------------
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]