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