[DOCS-563] documentation for valueOf() and toString() Created: 28/Sep/12 Updated: 30/Oct/23 Resolved: 18/Oct/12 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Days since reply: | 11 years, 17 weeks, 5 days ago | ||||||||||||||||||||||||
| Description |
|
valueOf() needs documentation. Need examples of the difference between valueOf() and toString(), especially for ObjectId type. The behavior of toString() changed in 2.2. The old behavior was to convert the ObjectId into a bare string (thus losing its type information); the new behavior is to produce text that indicates that it is an ObjectId with a hex value. |
| Comments |
| Comment by auto [ 19/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T22:07:53-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 19/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T21:27:03-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 19/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T21:11:01-07:00', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T15:39:31-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}Message: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T15:22:24-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}Message: edits: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-18T08:51:49-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-17T15:30:58-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-17T15:26:49-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 18/Oct/12 ] |
|
Author: {u'date': u'2012-10-17T14:42:51-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by Eric Milkie [ 28/Sep/12 ] |
|
I believe that any overrides of .toString() or .valueOf() are all found within mongo/shell/utils.js |
| Comment by Eric Milkie [ 28/Sep/12 ] |
|
This external post has some of the philosophy behind the changes: |
| Comment by Eric Milkie [ 28/Sep/12 ] |
|
I linked in the original server ticket, which has a description of the "before" and "after" formats for toString() for a variety of special types. |
| Comment by Ed Costello [ 28/Sep/12 ] |
|
We'll figure it out…is it solely ObjectID that these affect? |
| Comment by Ed Costello [ 28/Sep/12 ] |
|
We don't presently document either of these (in docs or the wiki)…are the method changes specific to ObjectID or across all uses of .valueOf and .toString under the SM & v8 engines? |