Skip to content

Instantly share code, notes, and snippets.

@danared
Created April 23, 2015 14:22
Show Gist options
  • Save danared/3088d0ea7d3cf2784ebd to your computer and use it in GitHub Desktop.
Save danared/3088d0ea7d3cf2784ebd to your computer and use it in GitHub Desktop.
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);
} else {
System.out.println("Names: " + names);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment