Browse Source

Added serialize() in from history.

Scott Munday 11 years ago
parent
commit
e15c5235d6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/pipeline/documentSources/UnwindDocumentSource.js

+ 5 - 0
lib/pipeline/documentSources/UnwindDocumentSource.js

@@ -196,6 +196,11 @@ proto.unwindPath = function unwindPath(fieldPath) {
 	this._unwinder = new klass.Unwinder(fieldPath);
 };
 
+proto.serialize = function serialize(builder, explain) {
+	if (!this._unwindPath) throw new Error("unwind path does not exist!");
+	builder[this.getSourceName()] = this._unwindPath.getPath(true);
+};
+
 /**
  * Creates a new UnwindDocumentSource with the input path as the path to unwind
  * @param {String} JsonElement this thing is *called* Json, but it expects a string