public void Test() { var db = new MemoryDocumentDatabase(); var coll = db.GetCollection("a"); for (var i = 0; i < 1000; ++i) { coll.Put(i.ToString(), i); } coll.EnsureIndex(new IndexDefinition() { JsonPath = JsonConvert.ParseJsonPath("$.B") }); coll.Put("A", new { K = 1, B = "one" }); db.Dump(); coll.Put("B", new { K = 2, B = "two" }); coll.Put("C", new { K = 2, B = "two" }); db.Dump(); var x = coll.Find(new { K = 2 }); var a = coll.Find(new {B = "two"}); }
public void Test() { var coll = new MemoryDocumentDatabase().GetCollection("test"); coll.Put("samplekey", 1); coll.Put("samplekey", 2); Assert.That(2, Is.EqualTo(coll.Get<int>("samplekey"))); }