0

How can i import csv with fields and arrays? mongoimport --db name --collection users --type=csv --file out.csv --fields email.verificationTokens.0.address,email.verificationTokens.0.when

Now in DB

    "email" : {
            "verificationTokens" : {
                    {
                            "address" : "mail",
                            "when" : ""
                    }
            }   
        }

I need:

            "email" : {
                    "verificationTokens" : [
                            {
                                    "address" : "mail",
                                    "when" : ""
                            }
                    ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.