This file contains hidden or 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
<dependency> | |
<groupId>org.mongodb.mongo-hadoop</groupId> | |
<artifactId>mongo-hadoop-core</artifactId> | |
<version>1.4.0</version> | |
</dependency> |
This file contains hidden or 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
dump/ | |
└── [4.3M] country | |
├── [2.1M] austria.bson | |
├── [ 87] austria.metadata.json | |
├── [2.1M] nigeria.bson | |
├── [ 87] nigeria.metadata.json | |
└── [ 140] system.indexes.bson | |
1 directory, 5 files |
This file contains hidden or 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
actionArray = [ | |
function one(cb) { | |
someAsyncFunction(params, function(err, results) { | |
if (err) { | |
cb(new Error(“There was an error”)); | |
} | |
console.log(“one”); | |
cb(null); | |
}); | |
}, |
This file contains hidden or 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
String xmlString = convertMapToXML(data); | |
<data> | |
<name>buzz</name> | |
<lastUpdate>20140606</lastUpdate> | |
<pets> | |
<pet>dog</pet> | |
<pet>cat</pet> | |
</pets> | |
<milestones> |
This file contains hidden or 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
db.createCollection( "email", { storageEngine: { | |
wiredTiger: { configString: "blockCompressor=zlib" }}}) |
This file contains hidden or 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
coll.find().map(new Function<Document, String>() { | |
@Override | |
public String apply(final Document document) { | |
return document.getString("name"); | |
} | |
}).into(names, new SingleResultCallback<List<String>>() { | |
@Override | |
public void onResult(final List<String> names, final Throwable t) { | |
if (t != null) { | |
System.out.println("There was an error: " + t); |
This file contains hidden or 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
collection.find().sort(new Document("offerAmount", 1)).skip(10).limit(30); |
This file contains hidden or 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
MongoCollection<Person> personColl = coll.withDocumentClass(Person.class); | |
MongoCursor<Person> cursor = personColl.find().iterator(); |
This file contains hidden or 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
MongoCursor<Document> cursor1 = coll.find().iterator(); | |
MongoCursor<Person> cursor2 = coll.find(Person.class).iterator(); |
This file contains hidden or 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
actionArray = [ | |
function one(cb) { | |
someAsyncFunction(params, function(err, results) { | |
if (err) { | |
cb(new Error(“There was an error”)); | |
} | |
console.log(“one”); | |
cb(null); | |
}); | |
}, |