public void AddEvent(string seriesId, DateTime? tstamp, IEnumerable<int> values) { int idx = seriesId.IndexOf('/'); string sid = seriesId; string cname = "mevents"; if (idx > 0) { cname = seriesId.Substring(0, idx); sid = seriesId.Substring(idx + 1); } var mev = new MEvent { Id = KeyGen.GetNextValue(cname), P = sid, Ts = tstamp.HasValue ? tstamp.Value : DateTime.Now, V = new List<int>(values) }; var r = Db.GetCollection(cname).Insert(mev); }
public void AddEvent(MEvent mev, string collection) { Db.GetCollection(collection).Insert(mev); }