Permalink
Browse files

add subselect to the singular BsonRecordQueryField

This at least makes subselect uniformly available when selecting a
subfield of an embedded record. When we're ready to make a
backwards-incompatible release, we can change subfield on
BsonRecordQueryField to not work in select-context, so the two fields
are even more consistent.
  • Loading branch information...
1 parent c95d1f3 commit 76f146bd6c8b2370347fa33366131b2478679b01 Neil Sanchala committed Dec 15, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/main/scala/com/foursquare/rogue/QueryField.scala
@@ -215,6 +215,8 @@ class BsonRecordQueryField[M <: MongoRecord[M], B <: BsonRecord[B]](field: Field
val rec = field.defaultValue // a hack to get at the embedded record
new SelectableDummyField[V, M](field.owner, field.name + "." + subfield(rec).name)
}
+
+ def subselect[V](f: B => Field[V, B]): SelectableDummyField[V, M] = subfield(f)
}
// This class is a hack to get $pull working for lists of objects. In that case,

0 comments on commit 76f146b

Please sign in to comment.