I get "UploadTimeType" : "string"
.
So I guess UploadTime is not type: Date.
How do I insert UploadTime as type Date?
I tried the following it didn’t work:
BsonDateTime uploadDate = new BsonDateTime(DateTime.Now);
var doc = new BsonDocument{
{"Documentid", strDocumentID},
{ "FileType", typeOfDocument},
{ "FileContent", file.ContentType},
{ "FileName", file.FileName},
{ "UploadTime", uploadDate },
{ "UploadedBy", uploadedBy},
{ "GridFSFileID", strGridFSFileID}
};
This did not work.