 		public function groupby(...terms):Query
 		{
 			_groupby = (terms.length > 0 ? terms : null);
+			return this;
+		}
+		
+		/**
+		 * Sets whether or not aggregate functions will be mapped to all
+		 * tuples in the data set. This allows the results of aggregate
+		 * operators to be applied for all tuples. For example, the
+		 * <code>map</code> directive allows queries of this form:
+		 * <pre>
+		 * var q:Query = select({a:div(a,sum(a))}).map().eval(...);
+		 * </pre>
+		 * <p>The result include normalized <code>a</code> values for
+		 * all tuples in the input data. Without the map directive, a
+		 * "group-by" for all data would be assumed and only a single tuple
+		 * would be returned in the result set (matching the normal behavior
+		 * of a SQL database). Map can also be specified with a
+		 * group-by clause, in which case the aggregate operators will be
+		 * handled separately for each group, but the result set will still
+		 * contain a result for every tuple in the input set.</p>
+		 * @param value if true (the default), aggregate operators will be
+		 *  applied (mapped) to all tuples; if false, normal group-by semantics
+		 *  will be used.
+		 * @return this query object
+		 */
+		public function map(value:Boolean=true):Query
+		{
+			_map = value;
 			return this;
 		}
 		

		 * @param items the filtered query results array
		 * @return aggregated query results array
		 */
		protected function group(items:Array):Array
		{
			var i:int, item:Object;
			var results:Array = [], props:Array = [];
			
			// get group-by properties as key

		 * @param results the filtered query results array
		 * @return query results array of projected objects
		 */
		private function projectAll(results:Array):Array
		{			
			for (var i:int=0; i<results.length; ++i) {
				var item:Object = {};
