MongoDB using VBNet to have data type of each field of a collection

Viewed 19

Request on MongoDB in VBNet application. I am very new in MongoDB. How can I have back the data type of each field in a collection. My ( poor :-) ) code for returning document from a collection is

Dim mongo As New MongoClient("mongodb://localhost:27017")
    Dim db = mongo.GetDatabase("ECOMP")
    Dim collection = db.GetCollection(Of BsonDocument)("Alpha")
    Dim q = New BsonDocument()
    '
    Dim documents = collection.Find(New BsonDocument()).ToList()
    '
    For Each doc As BsonDocument In documents.ToList()
        MsgBox("collection data" & doc.ToString)
    Next

How can I have back the data type of each field in a collection?

Thanks

Pierre

0 Answers
Related