This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.mongodb.*; | |
/** | |
* Created by tgrall on 8/27/14. | |
*/ | |
public class TestApp { | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
) | |
type City struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo; | |
import com.mapr.db.MapRDB; | |
import com.mapr.db.Table; | |
import org.ojai.Document; | |
import javax.print.Doc; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.couchbase.demo; | |
import com.couchbase.client.CouchbaseClient; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import twitter4j.*; | |
import twitter4j.json.DataObjectFactory; | |
import java.io.InputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<dependencies> | |
<dependency> | |
<groupId>com.couchbase.client</groupId> | |
<artifactId>couchbase-client</artifactId> | |
<version>1.2.3</version> | |
</dependency> | |
</dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import | |
import com.couchbase.client.CouchbaseClient; | |
... | |
... | |
List<URI> uris = new LinkedList<URI>(); | |
uris.add(URI.create("http://127.0.0.1:8091/pools")); | |
CouchbaseClient client = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View view = client.getView("brewery", "all_with_beers"); | |
Query query = new Query(); | |
query.setIncludeDocs(true).setLimit(100); | |
ViewResponse result = client.query(view, query); | |
ArrayList<HashMap<String, String>> items = | |
new ArrayList<HashMap<String, String>>(); | |
for(ViewRow row : result) { | |
HashMap<String, String> parsedDoc = gson.fromJson( | |
(String)row.getDocument(), HashMap.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc, meta) { | |
switch(doc.type) { | |
case "brewery": | |
emit([meta.id, 0, doc.name]); | |
break; | |
case "beer": | |
if (doc.name && doc.brewery_id) { | |
emit([doc.brewery_id, 1, doc.name], null); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.couchbase.devday; | |
import com.couchbase.client.CouchbaseClient; | |
import javax.imageio.ImageIO; | |
import java.awt.image.BufferedImage; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.InputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.couchbase.sample; | |
import com.couchbase.client.CouchbaseClient; | |
import com.google.gson.Gson; | |
import java.net.URI; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.UUID; |
OlderNewer