[SERVER-5638] DBRefs fail for _id values which are false Created: 17/Apr/12  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.0.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Glenn Maynard Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, neweng, platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

DBRef breaks in the shell when _id is 0, or null, or other valid _ids that happen to evaluate to false:

> new DBRef("a", 0).fetch()
assert failed : need an id
Error("Printing Stack Trace")@:0
()@shell/utils.js:35
("assert failed : need an id")@shell/utils.js:46
(0,"need an id")@shell/utils.js:54
()@shell/utils.js:572
@(shell):1

In shell/utils.js, DBRef.prototype.fetch should be:

assert(typeof(this.ns) !== 'undefined');
assert(typeof(this.id) !== 'undefined');



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

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