You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/02/03 16:13:19 UTC
[12/50] [abbrv] couchdb-mango git commit: Update README file
Update README file
Update README to include an information about added escape functionality.
Fix a typo in an old test's name
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/80253c45
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/80253c45
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/80253c45
Branch: refs/heads/master
Commit: 80253c45c6fe19035c011de5c7399126db175864
Parents: 2db372b
Author: Eric Avdey <e....@cloudant.com>
Authored: Tue Nov 4 12:25:46 2014 -0400
Committer: Eric Avdey <e....@cloudant.com>
Committed: Tue Nov 4 15:04:05 2014 -0400
----------------------------------------------------------------------
README.md | 12 +++++++++---
test/01-index-crud-test.py | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/80253c45/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 05bc128..9f7605a 100644
--- a/README.md
+++ b/README.md
@@ -221,6 +221,12 @@ There are two special syntax elements for the object keys in a selector. The fir
{"location": {"city": "Omaha"}}
{"location.city": "Omaha"}
+If the object's key contains the period it could be escaped with backslash, i.e.
+
+ {"location\\.city": "Omaha"}
+
+Note that the double backslash here is necessary to encode an actual single backslash.
+
The second important syntax element is the use of a dollar sign (`$`) prefix to denote operators. For example:
{"age": {"$gt": 21}}
@@ -229,7 +235,7 @@ In this example, we have created the boolean expression `age > 21`.
There are two core types of operators in the selector syntax: combination operators and condition operators. In general, combination operators contain groups of condition operators. We'll describe the list of each below.
-=== Implicit Operators ===
+### Implicit Operators
For the most part every operator must be of the form `{"$operator": argument}`. Though there are two implicit operators for selectors.
@@ -253,7 +259,7 @@ Although, the previous example would actually be normalized internally to this:
{"foo.bar": {"$eq": "baz"}}
-=== Combination Operators ===
+### Combination Operators
These operators are responsible for combining groups of condition operators. Most familiar are the standard boolean operators plus a few extra for working with JSON arrays.
@@ -268,7 +274,7 @@ The list of combining characters:
* "$all" - array argument (special operator for array values)
* "$elemMatch" - single argument (special operator for array values)
-=== Condition Operators ===
+### Condition Operators
Condition operators are specified on a per field basis and apply to the value indexed for that field. For instance, the basic "$eq" operator matches when the indexed field is equal to its argument. There is currently support for the basic equality and inequality operators as well as a number of meta operators. Some of these operators will accept any JSON argument while some require a specific JSON formatted argument. Each is noted below.
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/80253c45/test/01-index-crud-test.py
----------------------------------------------------------------------
diff --git a/test/01-index-crud-test.py b/test/01-index-crud-test.py
index b6ef786..1f8b8bf 100644
--- a/test/01-index-crud-test.py
+++ b/test/01-index-crud-test.py
@@ -186,7 +186,7 @@ def test_recreate_index():
assert pre_indexes == post_indexes
-def test_delete_misisng():
+def test_delete_missing():
db = mkdb()
# Missing design doc