How do I mongoexport attributes from an array of objects to CSV?

前端 未结 3 1944
故里飘歌
故里飘歌 2021-02-15 13:46

I need to export values of objects in an array to CSV. Let\'s say my document is:

{
    name:\"test\",
    types:[
        {type:\"A\"},
        {type:\"B\"},
                


        
3条回答
  •  灰色年华
    2021-02-15 13:57

    You'll have to write a custom script that iterates through collections and exports documents in desired format. Built-in mongoexport was not designed for use cases like yours.

提交回复
热议问题