[CSHARP-52] bugs in generated JavaScript Created: 21/Jul/10 Updated: 22/Jul/10 Resolved: 21/Jul/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Timofei Mironov | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
VS2008, .NET 3.5 |
||
| Description |
|
I was debugging one of my code and found interesting output for me. At the MongoQueryObject.Query there was text : { "$where": { "$code": "(((this.ServiceKey === 4c46d7657c1a601774000002) && (this.ResourceKey === 4c46d7657c1a601774000003)) && ((((this.Start >= 01/01/2000 10:00:00) && (this.Start < 01/01/2000 18:00:00)) || ((this.End > 01/01/2000 10:00:00) && (this.End <= 01/01/2000 18:00:00))) || ((this.Start < 01/01/2000 10:00:00) && (this.End > 01/01/2000 18:00:00))))" }} As i understand from MongoDb docs after $where should be JavaScrip Question 1: why it didn't translated into json notation to find Question 2: if it is JavaScript code, why values don't have quotes Maybe better make like the following link: http://groups.google.com/group/mongodb-csharp/browse_thread/thread/b00e288d0ebce78 |
| Comments |
| Comment by Timofei Mironov [ 22/Jul/10 ] |
|
public static string SerializeForServerSide(object value) .... } to sb.AppendFormat("new Date({0} , {1}, {2}, {3}, {4}, {5}, {6})", d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond); Should be d.Day instead of d.Date. |
| Comment by Timofei Mironov [ 22/Jul/10 ] |
|
Fix this code. from |
| Comment by Craig Wilson [ 21/Jul/10 ] |
|
This is fixed in my fork: http://github.com/craiggwilson/mongodb-csharp |