I am trying to add a simple list of strings:
string[] misc = {"a", "b", "c", "d"};
List<string> myList = new List<string>(misc);
mongo_collection.Insert(myList);
And it will return the error: “Subclass must implement GetDocumentID”
I tried this instead:
mongo_collection.InsertBatch(myList);
but it resulted in the same error. There has to be a way to insert this without creating a new class that inherits from List that implements GetDocumentID, right?
Thanks!
You are trying to put a List of type String into a mongo database. In order to add something to Mongo, it either has to be a Bson Object or you have to create a custom object, and map the properties so the Mongo knows how to convert your object into BSON.