[CSHARP-3273] $hint does not work with $natural as a modifier Created: 28/Nov/20 Updated: 27/Oct/23 Resolved: 01/Dec/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Read Operations |
| Affects Version/s: | 2.11.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Caio César S. Leonardi | Assignee: | Robert Stam |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
So, based on .hint() and $hint official documentation, I'm using this query on terminal:
The closest I was able to produce on C# was something like:
This code throws the exception:
But, the '.ToString()' method does seems to translate the command correctly:
So, if ToString() is getting it correctly, it should work, but it isn't.
On that note, shouldn't you create an C# equivalent to find().hint(index) to make it simpler to use hint ?
|
| Comments |
| Comment by Robert Stam [ 01/Dec/20 ] | ||||||||||||
|
Thanks for submitting what looked like a possible bug. Your code:
has a subtle error. The value of "$hint" should be a BsonDocument but you have set the value to a string. The correct form would be:
I'd also point out that the Modifiers option is Obsolete. You can provide a Hint more directly with:
|