[COMPASS-5744] Date fields show as $numberLong in JSON mode Created: 18/Apr/22  Updated: 29/Oct/23  Resolved: 13/Jan/23

Status: Closed
Project: Compass
Component/s: CRUD
Affects Version/s: 1.31.2
Fix Version/s: 1.36.0

Type: Bug Priority: Major - P3
Reporter: Adam Crowe Assignee: Le Roux Bodenstein
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

macOS Big Sur 11.6.5


Issue Links:
Related
is related to VSCODE-363 Date fields show as $numberLong in th... Open
Story Points: 2
Documentation Changes: Not Needed
Sprint: Iteration Narwhal, Iteration Quahog, Iteration Ragfish, Iteration Seahorse

 Description   

Problem Statement/Rationale

When editing a document in JSON mode or when duplicating a document, any Date type field now shows up as a $numberLong value instead of a UTC date string like before.

Steps to Reproduce

Edit any document in JSON mode with any number of Date type fields

Expected Results

 

{
  "myDateField": {
    "$date": "2022-04-18T00:00:00Z"
  }
}

 

 

 

Actual Results

{
  "myDateField": {
    "$date": {
      "$numberLong": "1648425600000"
    }
  }
} 

 



 Comments   
Comment by Githook User [ 03/Feb/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: COMPASS-5996-fix-negative-document-count
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Comment by Githook User [ 18/Jan/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: COMPASS-6388-focus-modal-content
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Comment by Githook User [ 16/Jan/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: 1.35-releases
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Comment by Githook User [ 13/Jan/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: automatically-type-next-array-item
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Comment by Githook User [ 13/Jan/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: remove-tracking-defaults
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Comment by Githook User [ 13/Jan/23 ]

Author:

{'name': 'Le Roux Bodenstein', 'email': 'lerouxb@gmail.com', 'username': 'lerouxb'}

Message: fix(crud): If a date is in the safe range, go with relaxed EJSON rather than canonical COMPASS-5744 (#3964)

  • if a date is in the safe range, go with relaxed ejson rather than canonical
  • extend comment
  • Update packages/hadron-document/src/utils.ts

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>

  • add a test for date formatting

Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Branch: main
https://github.com/mongodb-js/compass/commit/cbaa086f387b9c9b62aef9381297773a9794a200

Generated at Wed Feb 07 22:40:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.