[COMPASS-6432] When inserting item to an array, automatically type based on last item Created: 12/Jan/23  Updated: 15/Feb/23  Resolved: 02/Feb/23

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

Type: Task Priority: Major - P3
Reporter: Rhys Howell Assignee: Rhys Howell
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Seahorse, Iteration Turtle, Iteration Unicornfish

 Description   

Originally created from user feedback:
https://mongodb.slack.com/archives/C039T3GDDPC/p1673277712431899 

I do have some feedback for MongoDB Compass. Hoping this could be implemented. It is a small detail, but important for UX. I have included my feedback below.

-------

Here is the example use case:

I am editing a document within the object editor UI.
I have an array which contains Int32 values.
I click the button to add an element to the array.

A new object is created with the type String

Preferred use case:

I am editing a document within the object editor UI.
I have an array which contains Int32 values.
I click the button to add an element to the array.

A new object is created with the type Int32

Summary

When clicking the to add a new array element, the newly created element should inherit the type of its previous sibling. It should not always default to String. Well it can, and it works... however if I have an array of 7 Int32s, and I'm clicking the .. I am very highly likely wanting to add another Int32. Definitely not a String. I hope that makes sense



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

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: remove-tracking-defaults
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

Comment by Githook User [ 03/Feb/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: COMPASS-5996-fix-negative-document-count
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

Comment by Githook User [ 18/Jan/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: COMPASS-6388-focus-modal-content
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

Comment by Githook User [ 16/Jan/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: 1.35-releases
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

Comment by Githook User [ 16/Jan/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: COMPASS-6137-remove-unsafe-method-in-document-table
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

Comment by Githook User [ 14/Jan/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: feat(compass-crud): use type from last array element when inserting new element to array COMPASS-6432 (#3965)
Branch: main
https://github.com/mongodb-js/compass/commit/f6dcd616f47e1d3843402c3e0f47d541edec53f3

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