0

I want to save a javascript code as store function via Java API. The problem is that I don't know how to convert String (type 2) to code (type 13). I know that in PHP it's possible:

new mongo.Code("function myFunction() { return 123; }").

So is there any way to save stored function via Java API?

tckmn
  • 57,719
  • 27
  • 114
  • 156
St.
  • 521
  • 3
  • 8

1 Answers1

0

It's very similar in Java:

final Code code = new Code("function myFunction() { return 123; }");
St.
  • 521
  • 3
  • 8