[SERVER-61881] Error if "returnStoredSource" is non-boolean in $search Created: 03/Dec/21 Updated: 03/Dec/21 Resolved: 03/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ted Tuckman | Assignee: | Ted Tuckman |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Comments |
| Comment by Ted Tuckman [ 03/Dec/21 ] |
|
Good points. I'm happy to close this as won't do just wanted to bring it up as an option since mongod is acting on it. |
| Comment by Alexander Lukyanchikov [ 03/Dec/21 ] |
|
If encountered, mongot is going to throw an exception saying that "returnStoredSource should be a boolean" - similar to existing cases when provided type does not match expected. We do this automatically for all types including boolean, e.g. currently span near operator will throw the same error if you would try to pass a non-boolean for the inOrder option. on mongod not on mongot to save the trip I don't see a difference in parsing between existing $search options and this new one, so probably we can keep delegating this logic to mongot? Also, did you mean to save the trip for performance reasons? Isn't this case likely a manual/debug query when people just trying things out? My guess is that user queries shouldn't be malformed in a real production scenario. |