public static QueryComplete Where(BsonJavaScript javaScript) { if (javaScript == null) { throw new ArgumentNullException("javaScript"); } return new QueryComplete(new BsonDocument("$where", javaScript)); }
public void TestWhere() { var query = Query.Where("this.a > 3"); var expected = "{ \"$where\" : { \"$code\" : \"this.a > 3\" } }"; Assert.AreEqual(expected, query.ToJson()); }