/// <summary> /// From BSON /// </summary> public static LogRecord FromBson(BsonDocument doc) { var record = new LogRecord(); record.Command = CommandRecord.FromBson(doc); record.Events = EventRecordCollection.FromBson(doc.GetBsonArray("Events")); record._errors = record.Command.Handlers.Errors + record.Events.Errors; return record; }
/// <summary> /// Load record by command ID /// </summary> public LogRecord GetRecordByCommandId(String commandId) { var recordDoc = Write.Logs.FindOneAs <BsonDocument>(Query.EQ("_id", commandId)); return(LogRecord.FromBson(recordDoc)); }