0

I have collection in MongoDB , what i want to do is to retrieve data in the cassandra , and export it into a csv file . what i want is to transform each row into a , comma seperated string and insert it each time in the csv file , i started to collect the data in the collection , any help fir the rest , am new to c#, lany thanks

        var server = MongoServer.Create("mongodb://localhost:27017");
        var DB = server.GetDatabase("shop");
        var collection = DB.GetCollection<BsonDocument>("Mobiles");
        var list = collection.FindAll();

        foreach (var dox in list)
        {
            insert into the csv file 
        }

Thanks a lot

Maher HTB
  • 737
  • 3
  • 9
  • 23
  • SEE: [Writing data into CSV file](https://stackoverflow.com/questions/18757097/writing-data-into-csv-file) – Mad Myche May 23 '17 at 16:42
  • @MadMyche , the problem is not with writing data into csv , but i need help with geting columbs in a bson document and insert it into line in csv file Thanks – Maher HTB May 24 '17 at 08:02

0 Answers0