-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
Labels:None
-
Environment:Universal
-
Query
I am writing an application which tracks astronimical observations of targets. I have looked at documentation and it seems that I can use $elemMatch to find, for example, targets with at least one observation with (time > 1 week ago, type=photometry). However there doesn't seem to be a way to search for targets with at least 3 observations matching the criteria, or less than 2 matching observations etc.
This would be the equivilent of:
SELECT * FROM target JOIN observation [no need for ON clause because observation is embedded in target] WHERE observation.time>1281432059 AND observation.type='photometry' AND COUNT>=3 GROUP BY target.id
More info is at http://groups.google.com/group/mongodb-user/browse_thread/thread/a34e0b9296c8a075