[DOCS-1720] "mongo shell automatically prints results of find" misleading Created: 17/Jul/13 Updated: 30/Oct/23 Resolved: 22/Jul/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 10 years, 26 weeks, 5 days ago |
| Description |
|
The following is misleading:
The above "trick" only works if the assignment is in an initializing statement (var c = db.collection.find()), but not simply if the "cursor is assigned to a variable" (c = db.collection.find()). The latter doesn't work because the assignment operator returns an expression, and if the given expression evaluates to a cursor object, the mongo shell calls next() on the cursor and prints the results. |
| Comments |
| Comment by auto [ 16/Aug/13 ] |
|
Author: {u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by Kay Kim (Inactive) [ 22/Jul/13 ] |
|
integrated as part of the crud reorganization |