private static void Main(string[] args)
{
using(var mongo = new
Mongo("Server=flame.mongohq.com:27027;Username=xxxx;Password=xxxx"))
{
mongo.Connect();
var tests = mongo.GetDatabase("Tests");
var documents =
AddTagDocuments(tests.GetCollection("tags"), 100);
foreach(var document in documents)
Console.WriteLine(document);
}
}
private static IEnumerable<Document>
AddTagDocuments(IMongoCollection collection, int count)
{
var docs = new List<Document>();
for(var documentIndex = 1; documentIndex <= count;
documentIndex++)
{
var document = new Document {{"fooId", documentIndex}};
collection.Insert(document, true);
docs.Add(document);
}
return docs;
}
Can you crate an minimal example application which fails for you?
I figured it out. The Problem is that currently no auth is done one
query's. Only on commands. So the insert with safe mode false tries to
insert to an unauthenticated database and ignores the auth error
message. Whereas the safe mode true sends a command after the first
inserts and authenticate and so the following inserts are working.
I figured it out. The Problem is that currently no auth is done one
query's. Only on commands. So the insert with safe mode false tries to
insert to an unauthenticated database and ignores the auth error
message. Whereas the safe mode true sends a command after the first
inserts and authenticate and so the following inserts are working.
On 03.06.2010 13:44, craiggwilson wrote: