adding dynamic data to mongodb using C#.Net

414 views
Skip to first unread message

vijaya...@gmail.com

unread,
Apr 14, 2016, 8:17:52 AM4/14/16
to mongodb-user
Hi All,

I am quite new to Mongo and I am trying to add some dynamic data in Mongodb using C#.Net.

please find the data in the image attached. 

if you look at the data in the attached file, there are 2 snapshots one at the left and the other on the right in which the data keeps changing dynamically in terms of number of rows/columns and the names of the columns as well.

now I need to insert this kind of data into Mongo using C#.Net. Anyone who ever had a chance to work on such data please advise.

thanks everyone for your help in advance.



Wan Bachtiar

unread,
May 2, 2016, 1:02:37 AM5/2/16
to mongodb-user

I am trying to add some dynamic data in Mongodb using C#.Net.

Hi Vijayande,

As a start you could find out the source of the spreadsheet’s dynamic data, i.e. where the data is coming from. Having known the source, you could write a script or an application to read the source and insert into MongoDB. For guides and examples of C#.Net MongoDB driver see MongoDB .NET Driver Quick Tour.

You also need to figure out how to structure your data in MongoDB i.e. data model. For an example you could store drawings into a collection of documents below:

{
    _id: ObjectId(...),
    drg_id: 2,
    sync: 11,
    drg_number: "s1.00", 
    drg_title: "layout", 
    drg_status: "Approved"
}

Note that you should design your data model to support your application needs and requirements. For more examples and patterns see Data Model Examples and Patterns.

I would recommend to enrol in a free online course at MongoDB University to learn more about MongoDB. The next session for working with MongoDB C# Driver - M101N: MongoDB for .NET Developers starts on the 24th May.

Kind regards,

Wan.

Reply all
Reply to author
Forward
0 new messages