|
|
@@ -183,12 +183,20 @@ proto.setSource = function setSource(theSource) {
|
|
|
|
|
|
proto.serialize = function serialize(explain) {
|
|
|
if (!explain)
|
|
|
- return this.value();
|
|
|
+ return null;
|
|
|
|
|
|
if (!this._cursorWithContext)
|
|
|
throw new Error("code 17135; Cursor deleted.");
|
|
|
|
|
|
- return this.value(); // big stuff here
|
|
|
+ // A stab at what mongo wants
|
|
|
+ return {
|
|
|
+ query: this._query,
|
|
|
+ sort: this._sort ? this._sort : null,
|
|
|
+ limit: this._limit ? this._limit : null,
|
|
|
+ fields: this._projection ? this._projection : null,
|
|
|
+ indexonly: false,
|
|
|
+ cursorType: this._cursorWithContext ? "cursor" : null
|
|
|
+ };
|
|
|
};
|
|
|
|
|
|
// LimitDocumentSource has the setLimit function which trickles down to any documentsource
|