[Extension] Extension API and SDK changes for $_documentResultsAndMetadata

XMLWordPrintableJSON

    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Implement all extension API and SDK changes needed to support $_documentResultsAndMetadata in M1 (standalone execution). Sub-tasks cover the public C API enum, the skip_stream vtable addition, the create_document_results_and_metadata host service, and the ExecAggStageResultsAndMetadataSource SDK base class.

      Background

      The Extensions API currently only supports single-stream source stages. For \$search to migrate to the Extensions API, extensions need a way to produce two tagged streams (document results and metadata), signal to the host that metadata can be skipped, and call a host service to construct the \$_documentResultsAndMetadata container during expand(). This ticket tracks all M1 API and SDK surface for that capability. The DPL callback (M2 sharded execution) is out of scope here.

      Sub-tasks

      • Add MongoExtensionStreamType enum to api.h
      • Add skip_stream to MongoExtensionLogicalAggStageVTable (+ adapter + SDK virtual)
      • Implement create_document_results_and_metadata host service (+ SDK wrapper)
      • Implement ExecAggStageResultsAndMetadataSource SDK class

      Acceptance Criteria

      • All sub-tasks complete
      • A test extension can call createDocumentResultsAndMetadata during expand(), emit tagged two-stream docs via advanced(), and correctly suppress metadata when skipStream is called

            Assignee:
            Josh Siegel
            Reporter:
            Daniel Segel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: