Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0-beta, 2.0-beta-2, 2.0
-
None
-
Security Level: Public
-
None
Description
The page at:
http://www.couchbase.com/docs/couchbase-devguide-2.0/filter-extract-data.html
Shows several documents with the _id and _rev fields. These meta data fields are no longer inlined in documents after DP4.
Also, the field "language" for design documents has no special meaning in Couchbase (unlike Apache CouchDB), being superfluous and confusing to users.
There's also a map function example with duplicated if conditional:
function(doc) {
if (doc.title) {
if(doc.title)
}
}
Finally, the following paragraph:
"As a best practice we want make sure that the fields we want to include in our index actually exist. Therefore we have our map function within a conditional: if (doc.age && doc.name). This ensures the fields exist in documents when we query the view and we therefore avoid a view failure when Couchbase Server generates the index."
Is not completely correct. If doc.age or doc.name don't exist in a document, using them as keys or values doesn't produce an error.
Undefined fields in JavaScript are serialized to a JSON null value.
What would produce an error would be something like referencing doc.name.length, when name isn't defined in the document.