public static class DesignDocument.MapReduce
extends java.lang.Object
// Javascript view definition in design document
"views": {
"exampleView" : {
"map" : "function(doc) { emit(doc.propertyA, doc.propertyB); }"
"reduce" : "_count"
}
}
// Java example using MapReduce
// Get the views from the design document
Map<String, MapReduce> views = ddoc.getViews();
// Get the MapReduce for the "exampleView"
MapReduce exampleView = views.get("exampleView");
// Get the strings of the map and reduce functions
exampleView.getMap(); // "function(doc) { emit(doc.propertyA, doc.propertyB); }"
exampleView.getReduce(); // "_count"
Constructor and Description |
---|
MapReduce() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDbCopy()
Deprecated.
|
java.lang.String |
getMap()
Get the defined map function.
|
java.lang.String |
getReduce()
Get the defined reduce function.
|
int |
hashCode() |
void |
setDbCopy(java.lang.String databaseName)
Deprecated.
|
void |
setMap(java.lang.String map)
Set the map function.
|
void |
setReduce(java.lang.String reduce)
Set the reduce function.
|
public java.lang.String getMap()
public java.lang.String getReduce()
public void setMap(java.lang.String map)
map
- string of the javascript map functionpublic void setReduce(java.lang.String reduce)
reduce
- string of the javascript reduce function@Deprecated public void setDbCopy(java.lang.String databaseName)
Set the name of a database to copy the reduced view results into.
Use of the dbcopy
feature is deprecated and is strongly discouraged.
For more information, see the
Bluemix documentation for this feature.
databaseName
- of the database to store reduced view results ingetDbCopy()
@Deprecated public java.lang.String getDbCopy()
setDbCopy(String)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object