public Document SendCommand(Document cmd) { Document result = this.command.FindOne(cmd); double ok = (double)result["ok"]; if (ok != 1.0){ string msg; if(result.Contains("msg")){ msg = (string)result["msg"]; }else{ msg = string.Empty; } throw new MongoCommandException(msg,result,cmd); } return result; }
public Collection CreateCollection(String name, Document options) { Document cmd = new Document(); cmd.Append("create", name).Update(options); db.SendCommand(cmd); return(new Collection(name, connection, this.name)); }