[DOCS-6199] Comment on: "manual/reference/method/ObjectId.toString.txt" Created: 14/Sep/15  Updated: 03/Nov/17  Resolved: 15/Sep/15

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/master/reference/method/ObjectId.toString/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.22 Safari/537.36
Referrer: https://www.google.com.au/
Screen Resolution: 2560 x 1440
repo: docs
source: reference/method/ObjectId.toString


Participants:
Days since reply: 8 years, 22 weeks, 2 days ago

 Description   

I think the second code block is supposed to read

"507c7f79bcf86cd7994f6c0e"

instead of

ObjectId("507c7f79bcf86cd7994f6c0e")



 Comments   
Comment by Kay Kim (Inactive) [ 15/Sep/15 ]

In the mongo shell, the ObjectId(<xyz>).toString() method returns the string literal ObjectId(<xyz>)

> ObjectId("507c7f79bcf86cd7994f6c0e").toString()
ObjectId("507c7f79bcf86cd7994f6c0e")

If you set a variable to the ObjectId().toString(), it might be clearer:

> var x = ObjectId("507c7f79bcf86cd7994f6c0e").toString();
> x
ObjectId("507c7f79bcf86cd7994f6c0e")
> typeof x
string

Generated at Thu Feb 08 07:51:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.