'use strict';

var _ = require('underscore');
var SourceCollection = require('mongodb').Collection;

module.exports = function(Collection) {
	Collection.prototype.aggregate = function(pipeline, options) {
		options = _({}).defaults(
			options,
			{cursor: {}}
		);

		return SourceCollection.prototype.aggregate.call(this, pipeline, options);
	};
};

@@ -12,39 +12,8 @@
 ';%0A%0A
-var _ = require('underscore');%0A
 var 
@@ -61,16 +61,49 @@
 lection;
+%0Avar utils = require('../utils');
 %0A%0Amodule
@@ -206,46 +206,55 @@
 %7B%0A%09%09
+if (
 options
- = _(%7B%7D).defaults(%0A%09%09%09options,%0A
+) %7B%0A%09%09%09options = utils.deepExtend(%0A%09
 %09%09%09%7B
@@ -268,13 +268,31 @@
  %7B%7D%7D
+,
 %0A%09%09
-);
+%09%09options%0A%09%09%09);%0A%09%09%7D
 %0A%0A%09%09

use local utils instead of underscore