public void TestHashedAscending() { var keys = IndexKeys.Hashed("a").Ascending("b"); string expected = "{ \"a\" : \"hashed\", \"b\" : 1 }"; Assert.AreEqual(expected, keys.ToJson()); }
public void TestHashed() { var keys = IndexKeys.Hashed("a"); string expected = "{ \"a\" : \"hashed\" }"; Assert.AreEqual(expected, keys.ToJson()); }
private void InitializeConnection(string connectionString) { var database = MongoDatabase.Create(connectionString); _collection = database.GetCollection <User>("users"); _collection.CreateIndex(IndexKeys <User> .Hashed(index => index.Id)); }
public void TestHashedAscending() { var keys = IndexKeys <Test> .Hashed(x => x.A).Ascending(x => x.B); string expected = "{ \"a\" : \"hashed\", \"b\" : 1 }"; Assert.Equal(expected, keys.ToJson()); }
public void TestHashed() { var keys = IndexKeys <Test> .Hashed(x => x.A); string expected = "{ \"a\" : \"hashed\" }"; Assert.Equal(expected, keys.ToJson()); }
public MongoIndexKeysWarpper Hashed(string name) { if (MongoIndexKeys == null) { MongoIndexKeys = IndexKeys.Hashed(name); } else { MongoIndexKeys = MongoIndexKeys.Hashed(name); } return(this); }