Пример #1
0
 public Query and(string field, Query query)
 {
     try
     {
         List <Dictionary <string, Dictionary <string, object> > > list = new List <Dictionary <string, Dictionary <string, object> > >();
         Dictionary <string, object> queryParam1 = (Dictionary <string, Object>)query.getQueryInfo().GetValueOrDefault(field);
         Dictionary <string, object> queryParam2 = (Dictionary <string, Object>)queryInfo.GetValueOrDefault(field);
         Dictionary <string, Dictionary <string, object> > parameter1 = new Dictionary <string, Dictionary <string, object> >();
         parameter1.Add(field, queryParam1);
         Dictionary <string, Dictionary <String, Object> > parameter2 = new Dictionary <string, Dictionary <string, object> >();
         parameter2.Add(field, queryParam2);
         list.Add(parameter1);
         list.Add(parameter2);
         queryInfo.Remove(field);
         queryInfo.Add("$and", list);
     }
     catch (Exception ex)
     {
         //e.printStackTrace();
         throw ex;
     }
     return(this);
 }