Skip to content
Browse files

Changed Collection.Insert to take an IEnumerable<Document> to provide…

… more flexibility.
  • Loading branch information...
1 parent c0cfd34 commit fcd14c9c2fce83168bb378e2c62d3a1b9403c282 @samus committed Sep 10, 2009
Showing with 10,006 additions and 10,005 deletions.
  1. +9,999 −9,999 MongoDB.Net-Tests/test-data/tests.reads.txt
  2. +2 −6 MongoDBDriver/Collection.cs
  3. +5 −0 README.rst
View
19,998 MongoDB.Net-Tests/test-data/tests.reads.txt
9,999 additions, 9,999 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
8 MongoDBDriver/Collection.cs
@@ -96,14 +96,10 @@ public Collection(string name, Connection conn, string dbName)
this.Insert(docs);
}
- public void Insert(List<Document> docs){
- this.Insert(docs.ToArray());
- }
-
- public void Insert(Document[] docs){
+ public void Insert(IEnumerable<Document> docs){
InsertMessage im = new InsertMessage();
im.FullCollectionName = this.FullName;
- List<BsonDocument> bdocs = new List<BsonDocument>(docs.Length);
+ List<BsonDocument> bdocs = new List<BsonDocument>();
foreach(Document doc in docs){
bdocs.Add(BsonConvert.From(doc));
}
View
5 README.rst
@@ -52,4 +52,9 @@ At the simplest query the database like this:
Document result = db["tests"]["reads"].FindOne(query);
db.Disconnect();
+Contributors
+============
+Sam Corder (samus)
+Sergey Bartunov (sbos)
+

0 comments on commit fcd14c9

Please sign in to comment.
Something went wrong with that request. Please try again.