[GODRIVER-1743] tying to use $function but got error syntax Created: 08/Sep/20  Updated: 27/Oct/23  Resolved: 28/Sep/20

Status: Closed
Project: Go Driver
Component/s: API, BSON
Affects Version/s: 1.4.1
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Virtual Database Assignee: Kevin Albertson
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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 

 



 Comments   
Comment by Esha Bhargava [ 28/Sep/20 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to leave another comment on this if we've missed something.

Comment by Esha Bhargava [ 08/Sep/20 ]

justtemporary@niepodam.pl Can you send us the repro code and the actual error message?

Generated at Thu Feb 08 08:37:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.