Implement create_id_lookup in the Extensions API

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In order to restrict the usage of $_internalSearchIdLookup, we will only allow extensions to desugar into an $idlookup if they generate an AstNode directly from the Host which can be later parsed into a DocumentSource.

      We need to provide an API which extensions can call to allocate such an AstNode. 

      As part of this ticket, implement create_id_lookup:

      // Addition to MongoExtensionHostPortaltypedef struct MongoExtensionHostPortalVTable {
      /** * create_id_lookup: Creates a Host implemented AstNode for an $_internalSearchIdLookup 
      * stage. If the provided bsonSpec does not specify a valid $_internalSearchIdLookup 
      * stage, an error is returned. On success, the BsonNode is populated with the host's 
      * AstNode.   
      */
      MongoExtensionStatus* (*create_id_lookup)(MongoExtensionByteView bsonSpec,                                          
      MongoExtensionAggregationStageAstNode** node);} MongoExtensionHostPortalVTable; 

      the implementation of create_id_lookup should verify that the provided spec is for an $_internalSearchIdLookup , it must match the IDL specification of the stage or throw an error if it is not.
      The rest of the parsing verification will be performed during the parse on the Host side.
      Things to look into:

      • Is the HostPortal the best place to keep this function? Are we able to keep a pointer to the HostPortal at all times?
      • Implement unit testing

       

            Assignee:
            Unassigned
            Reporter:
            Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: