Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1743

tying to use $function but got error syntax

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • 1.4.1
    • API, BSON
    • None

    Description

      I am trying new feature on mongo-driver for `$function` , here is my syntax

       

      function := fmt.Sprintf("function(p) { return p; }")
      addFunc := bson.D{
         {"$addFields", bson.D{
            {"addFunc", bson.D{
               {"$function", bson.D{
                  {"body", function},
                  {"args", bson.A{"yes"}},
                  {"lang", "js"},
               }},
            }},
         }},
      }
      

      I use that addFunc init my aggregate pipeline, and it took long to proses if add that `addFunc` into my pipeline aggregate, and at the end, I got error "must not be null" , I don't know what's wrong with it, is that any idea for my case? or mongodb go not support $function yet??
      I am using latest mongo atlas 

       

      Attachments

        Activity

          People

            kevin.albertson@mongodb.com Kevin Albertson
            justtemporary@niepodam.pl Virtual Database
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: