MongoDB
 sql >> Datenbank >  >> NoSQL >> MongoDB

InsertMany Document in einer MongoDB-Sammlung mit C# BsonArray

Auf den ersten Blick liegt der Build-Fehler höchstwahrscheinlich daran, dass InsertMany -Methode erwartet eine Sammlung (IEnumerable ,List oder Array ..) von BsonDocument anstelle eines BsonArray .

versuche :

var EmpInfoArray = new List<BsonDocument>() { //Changed BsonArray to List<BsonDocument>
    new BsonDocument
    {
        {"EmpID", "100"},
        {"EmpName", "John"},
        {"EmpMobile", new BsonArray
        .
        .
        .