|
|
@@ -86,6 +86,7 @@ klass.Unwinder = (function() {
|
|
|
/**
|
|
|
* Get the document source name.
|
|
|
*
|
|
|
+ * @method getSourceName
|
|
|
* @returns {string}
|
|
|
*/
|
|
|
proto.getSourceName = function getSourceName() {
|
|
|
@@ -95,6 +96,7 @@ proto.getSourceName = function getSourceName() {
|
|
|
/**
|
|
|
* Get the next source.
|
|
|
*
|
|
|
+ * @method getNext
|
|
|
* @param callback
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
@@ -150,6 +152,7 @@ proto.getNext = function getNext(callback) {
|
|
|
/**
|
|
|
* Serialize the data.
|
|
|
*
|
|
|
+ * @method serialize
|
|
|
* @param explain
|
|
|
* @returns {{}}
|
|
|
*/
|
|
|
@@ -168,6 +171,7 @@ proto.serialize = function serialize(explain) {
|
|
|
/**
|
|
|
* Get the fields this operation needs to do its job.
|
|
|
*
|
|
|
+ * @method getDependencies
|
|
|
* @param deps
|
|
|
* @returns {DocumentSource.GetDepsReturn.SEE_NEXT|*}
|
|
|
*/
|
|
|
@@ -184,6 +188,7 @@ proto.getDependencies = function getDependencies(deps) {
|
|
|
/**
|
|
|
* Unwind path.
|
|
|
*
|
|
|
+ * @method unwindPath
|
|
|
* @param fieldPath
|
|
|
*/
|
|
|
proto.unwindPath = function unwindPath(fieldPath) {
|
|
|
@@ -196,19 +201,9 @@ proto.unwindPath = function unwindPath(fieldPath) {
|
|
|
this._unwinder = new klass.Unwinder(fieldPath);
|
|
|
};
|
|
|
|
|
|
-/**
|
|
|
- * Serialize the data associated with the unwind path.
|
|
|
- *
|
|
|
- * @param builder
|
|
|
- * @param explain
|
|
|
- */
|
|
|
-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
|
|
|
+ * @method createFromJson
|
|
|
* @param {String} JsonElement this thing is *called* Json, but it expects a string
|
|
|
**/
|
|
|
klass.createFromJson = function createFromJson(jsonElement, ctx) {
|