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?

4

1 回答 1

0

它在 Java 中非常相似:

final Code code = new Code("function myFunction() { return 123; }");
于 2013-05-29T17:35:55.883 回答