-
Notifications
You must be signed in to change notification settings - Fork 2
COMPASS-3826 COMPASS-3947: Import preview table with project and type customization #18
Conversation
30e9a45
to
d5a8766
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments on the UX side of things!
In response to your comments from above:
Change to utils/import/.js instead of utils/import-.js?
I like the import-*.js
, but that could be just be me!
The preview could have partial objects if spill over into next buffer. Can we back pressure against the input source for real instead of this hacky impl?
Replied in comments! tl;dr: i think peek-stream is meant to make sure we don't deal with partial objects.
move EJSON.deserialize() from parsers to apply-import-type-and-projection?
Not sure which EJSON.deserialize()
you mean? There is a comment for progressStream
in the parsers file, but I think it makes sense to have that with the parsers. Since when you parse, you have progress.
better name for apply-import-type-and-projection?
I think with the style of import-*.js
style, would be good to have it as import-apply-type-and-projection
. But otherwise it's nice and descriptive and I right away understand what's going on.
Makes loadPreview() simpler
to chat w @sampoonachot about the "need to tweak options until it looks right" case.
add a test case for this weird bug i found
6c263d7
to
784e575
Compare
Cutting master so all of your export improvements from the past few days can be upstreamed into compass asap with @mongodb-js/compass-import-export@^4.2.0. The import type casting stuff in #18 is complex enough that I don't want it blocking so it will go as 5.0.0. We can keep this 4.x-releases branch ref around just in case casting performance is a real dud and we want to take another stab at it. Now that this release has been published, a PR to mongodb-js/compass 📦 @mongodb-js/compass-import-export@^4.2.0 has changelog: UX improvements: display doc count, do not display line numbers #20 COMPASS-3961: allow adding missing fields #19 COMPASS-3851: ability to add fields when exporting collection #17
Shows a preview table: https://mongodb-js.github.io/compass-import-export/?path=/story/examples-importpreview--simple You can change type value will be cast to when saved to a document or exclude it entirely. mongodb-js/compass-import-export#18
Description
Adds a preview table of the file you are importing with checkboxes to exclude fields and select to specify a different type.
Motivation and Context
Using Import to Reshape Apple Health Data Export
;
Default to CSV:
Tweak delimiter so it looks right:
Specified field transforms:
Import done:

CRUD has my enriched types:
And the schema view is super pretty:
Types of changes
Open questions
utils/import/*.js
instead ofutils/import-*.js
?EJSON.deserialize()
from parsers to apply-import-type-and-projection?