[DOCS-10379] $where documentation misleading with regard to string expressions Created: 11/Jun/17  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Neil Lunn Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

The documentation for the $where operator makes a misleading statement in regard to usage with other drivers outside of it's usage in the MongoDB shell environment:

Additionally, if the query consists only of the $where operator, you can pass in just the JavaScript expression or JavaScript functions, as in the following examples:

 
db.myCollection.find( "this.credits == this.debits || this.credits > this.debits" );
 
db.myCollection.find( function() { return (this.credits == this.debits || this.credits > this.debits ) } );

The problem is particularly with the initial syntax showing the expression as a string being the only argument to .find(), which of course only applies to the shell method syntax and is not supported in any other drivers.

The statement in the documentation needs clarification that this is the supported shell syntax and at the very least may not be supported in other available drivers.

Ref: Mongo not behaving according to docs, with regards to implicit $where clause



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 08:00:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.