Selection of EJSON or JSON function return type

The option to select if a function returns EJSON or JSON was removed. WHY?

Hi @michael_schiller,

The option to return EJSON or JSON has never been part of the Function itself (a Function, per se, can return any kind of result, including complex objects), but rather of the HTTPS Endpoints Settings, and it’s still available. Can you please elaborate on what are you seeing?

Yes you are correct, my bad.
But it would have been nice if this option was available at the function level.

Hi @michael_schiller,

Glad we could help!

As explained above, a Function can be called in several environments (including Triggers, Authentication, other Functions, etc.), not just HTTPS Endpoints, so keeping them able to return everything is a requirement. OTOH, HTTPS Responses are limited in what they can contain, so conversion to JSON or EJSON is necessary.