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