In my MongoDB collection, I have a document with an array entry. How to get these array values โโas an array of strings in C #? I can return the document itself, but I cannot get the values โโof the array. Here is where I can:
QueryDocument findUser = new QueryDocument("_id" , id); BsonDocument user = bsonCollection.FindOne(findUser);
So, in this document, user
has an array that I would like to get and parse into an array of strings. The document looks something like this:
{ "firstname" : "jon", "secondname" : "smith", "loves" : ["this","that","other stuff"] }
source share