[JAVA-1782] Document that eval is deprecated in 3.0 Created: 28/Apr/15 Updated: 24/Aug/15 Resolved: 28/Apr/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Documentation |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | William Chan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | documentation | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Based on http://docs.mongodb.org/manual/reference/command/eval/ and http://docs.mongodb.org/manual/reference/method/db.eval/, eval is deprecated in 3.0. DB#eval and DB#doEval should be marked as deprecated. Also, I would really appreciate comments suggesting what to use instead of eval. To quote the existing comments: eval "Evaluates JavaScript functions on the database server. This is useful if you need to touch a lot of data lightly, in which case network transfer could be a bottleneck." What is a good alternative to this? |
| Comments |
| Comment by Ross Lawley [ 28/Apr/15 ] |
|
Added a |
| Comment by Ross Lawley [ 28/Apr/15 ] |
|
Hi willchan83, In 3.0.0 MongoClient.getDB() was deprecated meaning that all code under DB has been deprecated - including DB#eval and DB#doEval. We haven't added a eval helper in MongoDatabase (the DB replacement) but there is the runCommand helper for running arbitrary commands. The eval command was deprecated in
There is no alternative from a driver perspective other than coding the functionality from the driver. However, you still can use the shell directly, which is a javascript runtime. I hope that answers your question and as there is no work to be done I'm going to close this ticket "Works as Designed". For future reference, the best place for general questions regarding MongoDB usage or the Java driver specifics is the mongodb-user mailinglist or stackoverflow as you will reach a boarder audience there. |