using MongoDB.Driver;
using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("SchoolDB");
var collection = database.GetCollection<BsonDocument>("students");
var students = new List<BsonDocument>
{
new BsonDocument { { "name", "Alice" }, { "age", 20 }, { "major", "Computer Science" } },
new BsonDocument { { "name", "Bob" }, { "age", 22 }, { "major", "Mathematics" } },
new BsonDocument { { "name", "Charlie" }, { "age", 21 }, { "major", "Physics" } }
};
collection.InsertMany(students);
}
}