public static void InsertToStockInfo(MongoConnection conn, BsonDocument sentimentResult, BsonDocument stockListing, string status, string tradeable, string currentPrice, string historicalData) { StockCorrelation stockCorrelation = new StockCorrelation(); stockCorrelation.InitEmpty(); stockCorrelation.SentimentResult = sentimentResult; stockCorrelation.StockListing = stockListing.ToBsonDocument(); stockCorrelation.Status = status; stockCorrelation.Tradeable = tradeable; stockCorrelation.CurrentPrice = currentPrice; stockCorrelation.HistoricalData = historicalData; InsertToStockInfo(conn, stockCorrelation); }
public static void InsertToStockInfo(MongoConnection conn, StockCorrelation correlation) { ObjectId stockCorrelationId = new ObjectId(); stockCorrelationId = conn.InsertDocument("stock_info", correlation.GetBsonDocument()); if (stockCorrelationId == null || stockCorrelationId.Equals("")) { Console.WriteLine("Stock Correlation: " + "Insert Document returned empty? " + stockCorrelationId); } else { Console.WriteLine("Stock Correlation: " + "Successfully inserted stock correlation into stock_info at id: " + stockCorrelationId); } }