[DOCS-10862] Docs for SERVER-23410: Improve or remove support for dates in string expressions Created: 04/Oct/17  Updated: 29/Oct/23  Resolved: 20/Oct/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.14, 3.6.0-rc0

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-23410 Improve or remove support for dates i... Closed
Participants:
Days since reply: 6 years, 16 weeks, 5 days ago
Epic Link: DOCS: 3.6 Server

 Description   

Documentation Request Summary:

No documentation summary in engineering ticket

Engineering Ticket Description:

A couple string expressions (notably in $substr(Bytes) and $concat) support dates as inputs, but do not include the number of milliseconds:

> db.foo.insert({x: new Date()})
WriteResult({ "nInserted" : 1 })
> db.foo.find()
{ "_id" : ObjectId("56fae3003ef38a5ce210b230"), "x" : ISODate("2016-03-29T20:18:08.339Z") }
> db.foo.aggregate({$project: {x: {$substr: ["$x", 0, 200]}}})
{ "_id" : ObjectId("56fae3003ef38a5ce210b230"), "x" : "2016-03-29T20:18:08" }

We should either fix these places to include the number of milliseconds, or remove support for using these expressions with date types.

One possible way forward is to add a $toString expression (related to SERVER-11400), then remove support and require an explicit conversion instead.



 Comments   
Comment by Githook User [ 20/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: DOCS-10862 dates coerced into strings differently

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/4b411a2d0f60bbac7a9574380a1e221f6b42300d

Generated at Thu Feb 08 08:01:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.