[SERVER-7433] DBQuery.prototype.comment should behave similarly to sort() Created: 19/Oct/12  Updated: 07/Dec/15  Resolved: 07/Dec/15

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

It looks like
DBQuery.prototype.comment clones a cursor and returns its first
result. And this seems different from other DBQuery functions that
call _addSpecial() just to modify an existing query (eg
DBQuery.prototype.sort)

DBQuery.prototype.comment = function (comment) {
    var n = this.clone();
    n._ensureSpecial();
    n._addSpecial("$comment", comment);
    return this.next();
}



 Comments   
Comment by David Storch [ 07/Dec/15 ]

Looks like this has been fixed already. The current implementation of DBQuery.prototype.comment in the shell looks like this:

DBQuery.prototype.comment = function (comment) {
    return this._addSpecial( "$comment" , comment );
}

Closing as Gone Away.

Generated at Thu Feb 08 03:14:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.