[CSHARP-713] MongoDatabase.Eval doesn't send argument to server when there is exactly one argument Created: 26/Mar/13 Updated: 20/Mar/14 Resolved: 26/Mar/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8 |
| Fix Version/s: | 1.8.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Keith Anders | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | c#, driver, eval, javascript | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 x64, connecting to MongoDB 2.4.0, Visual Studio 2010 |
||
| Attachments: |
|
| Description |
|
When using db.eval(myJS, "myStringArgument"), any attempt to use the argument in a javascript context will treat it as undefined, and any attempt to use it in a BSON context will use it as BsonNull. In the attached sample solution, the return value of the function comes up as BsonNull, and the document saved to the database is of the form { name: null }. |
| Comments |
| Comment by auto [ 26/Mar/13 ] |
|
Author: {u'date': u'2013-03-26T21:18:57Z', u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |
| Comment by Robert Stam [ 26/Mar/13 ] |
|
MongoDatabase.Eval only fails when there is exactly one argument. A workaround for now could be to pass an extra dummy argument. Thanks for reporting the issue. |