Skip to content

Conversation

imlucas
Copy link
Contributor

@imlucas imlucas commented Mar 19, 2020

Description

  • fix(import): COMPASS-4206: Make type detection/casting work right when importing/exporting .json. a093933
  • feat(export): Pick up nested objects to include in projection f6baf06
doc = {
  _id: 'Arlo', 
  location: {
    place: 'home',
    activity: {
       sleeping: true,
       is: 'on the couch'
    }
};

Before this would populate the projection as:

  • _id
  • location

Now you can specify full paths for more control over what is actually returned:

  • _id
  • location.place
  • location.activity.is
  • location.activity.sleeping

Use case: (See a 1M line csv imported that is 300 fields wide and you only want 2).

  • fix(export): Add tests to make sure csv's have correct headers. df70ff9

  • fix(export): Headers should be dotnotation for nested object paths.

Testing

Dicogs CSV

https://www.npmjs.com/package/discogs-data-tools

mongoexport CSV of all label names in the dicogs database:

Screenshot 2020-03-20 17 32 56

BitTorrent Data Set CSV

Andy Pavlo's BitTorrent Data Set

Screenshot 2020-03-20 17 18 26

Export test.people with only address.city

Screenshot 2020-03-20 17 40 54

Screenshot 2020-03-20 17 37 26

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed

  • Patch (non-breaking change which fixes an issue)

  • Minor (non-breaking change which adds functionality)

  • Major (fix or feature that would cause existing functionality to change)

@imlucas imlucas marked this pull request as ready for review March 20, 2020 21:42
@imlucas imlucas merged commit 951f7a5 into master Mar 23, 2020
@imlucas imlucas deleted the fix-import-json-type-detection branch March 23, 2020 17:19
imlucas added a commit that referenced this pull request Apr 2, 2020
…rmatting. (#1925)

* fix(import): COMPASS-4206: Fix type detection and export formatting.

mongodb-js/compass-import-export#144

* fix(import): COMPASS-4026: More fixes for importing EJSON

* chore(security): npm audit fix

fixed 121 of 256 vulnerabilities in 36223 scanned packages
@imlucas
Copy link
Contributor Author

imlucas commented Apr 2, 2020

Backported to 1.21-releases 39d0ad9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant