i am getting Error : MongoError: No array filter found for identifier 'i' in path 'mainCourse.$[i].subCourse.$[j].ppt'

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.0.4
    • Component/s: JavaScript
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      var pId=random('Aa0', 6);
      db.collection('test').updateOne({ F_id : req.params.F_id },{ $push : { "mainCourse.$[i].subCourse.$[j].ppt" :

      { pageid : pId , pagelink : link+'/ppt/'+fileName }

      } } ,{ arrayFilters : [

      { 'i.id' : req.params.MC_id }

      , { "j.id" : req.params.SC_id } ]}, (e,r)=>{
      if(e)

      { return res.send(\{Error :'Y' , msg :'Here Database Error '+e}

      );
      }
      return res.send({Error :'N' , msg :'PPT Added Successfully'});
      });
       
      i need to push data in ppt  see in ScreenShot
       
      i am getting Error like this :
       
      MongoError: No array filter found for identifier 'i' in path 'mainCourse.$[i].subCourse.$[j].ppt'
       
      or Any other way to push data in ppt please give suggestion
       

            Assignee:
            Kelsey Schubert
            Reporter:
            Malaviya Digant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: