Created
January 3, 2011 20:06
-
-
Save bwmcadams/763876 to your computer and use it in GitHub Desktop.
Select a limited set of fields with Casbah
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
import com.mongodb.casbah.Imports._ | |
val conn = MongoConnection() | |
val db = conn("test") | |
val coll = db("foo") | |
for (x <- coll.find(MongoDBObject("_id" -> new ObjectId("4cd2d357c575954934c5a975")), | |
MongoDBObject("x" -> 1))) println(x) | |
/** { "_id" : { "$oid" : "4cd2d357c575954934c5a975"} , "a" : [ 1.0 , 8.0 , 10.0 , 3.0 , 5.0 , 6.0 , 123.0]} */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment