Inheritance: QueryBuilder, IMongoQuery
Exemple #1
0
 /// <summary>
 /// Adds an $elemMatch test to the query.
 /// </summary>
 /// <param name="query">The query to match elements with.</param>
 /// <returns>The builder (so method calls can be chained).</returns>
 public QueryConditionList ElemMatch(
     QueryComplete query
     )
 {
     conditions.Add("$elemMatch", query.ToBsonDocument());
     return(this);
 }
Exemple #2
0
 /// <summary>
 /// Adds an $elemMatch test to the query.
 /// </summary>
 /// <param name="name">The name of the element to test.</param>
 /// <param name="query">The query to match elements with.</param>
 /// <returns>The builder (so method calls can be chained).</returns>
 public static QueryConditionList ElemMatch(
     string name,
     QueryComplete query
     )
 {
     return(new QueryConditionList(name).ElemMatch(query));
 }
 public static QueryConditionList ElemMatch(
     string name,
     QueryComplete query
 )
 {
     return new QueryConditionList(name, "$elemMatch", query.ToBsonDocument());
 }
Exemple #4
0
 /// <summary>
 /// GEP상품 리스트 페이징
 /// </summary>
 /// <param name="page">페이지</param>
 /// <param name="query">조건</param>
 /// <returns>GepItemsData Class List</returns>
 public MongoPagingResult<GepItemsData> List(int page, QueryComplete query)
 {
     SortByBuilder sort = SortBy.Descending("_id");
     List<GepItemsData> List = new List<GepItemsData>();
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "gep_items");
     return MongoHelper.FindByPaging<GepItemsData>(query, 10, (10 * (page - 1)), sort);
 }
Exemple #5
0
 private QueryComplete getQuery(string[] keywords)
 {
     QueryComplete[] qries = new QueryComplete[keywords.Length];
     int index = 0;
     foreach (string keyword in keywords)
     {
         qries[index] = Query.EQ("Keywords", new Regex(keyword, RegexOptions.IgnoreCase));
         index++;
     }
     return Query.Or(qries);
 }
Exemple #6
0
 public void SetQuery(QueryComplete queryComplete)
 {
     if (this.QueryComplete != null)
     {
         this.QueryComplete = QueryBuilder.Query.And(this.QueryComplete, queryComplete);
     }
     else
     {
         this.QueryComplete = queryComplete;
     }
 }
Exemple #7
0
        public static void ParseList(IEnumerable<string> filterQuery, QueryComplete andQuery, out QueryComplete totalQuery)
        {
            if (filterQuery == null || filterQuery.Count() <= 0)
            {
                totalQuery = andQuery;
                return;
            }

            var andQueryList = new List<IMongoQuery>();
            foreach (var filter in filterQuery)
            {
                var v = filter.Split('~');
                andQueryList.Add(Query.Or(Parse(v[0], v[1])));
            }
            andQueryList.Add(andQuery);
            totalQuery = Query.And(andQueryList.ToArray());
        }
 private void PushQuery(QueryComplete query)
 {
     _queries.Push(new ExpressionTreeElement(query));
 }
Exemple #9
0
 /// <summary>
 /// 根据条件获取内容集合的公共方法
 /// </summary>
 /// <param name="qc">查询条件</param>
 /// <param name="pagesize">每页条数</param>
 /// <param name="pageno">页数</param>
 /// <returns></returns>
 public static IList<PublicContent> getContentList(QueryComplete qc, SortByDocument order, int pagesize, int pageno)
 {
     try
     {
         MongoCursor<BsonDocument> mc = MongoDBHelper.GetCursor<BsonDocument>(PublicContent.GetCollectionName(), qc, order, pageno, pagesize);
         new SortByDocument("UpdateTime", -1);
         return ContentResolve(mc);
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Exemple #10
0
 /// <summary>
 /// GEP 상품 한건 보기
 /// </summary>
 /// <param name="query">조건</param>
 /// <returns>GepItemsData Class</returns>
 public GepItemsData View(QueryComplete query)
 {
     List<GepItemsData> List = new List<GepItemsData>();
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "gep_items");
     return MongoHelper.FindOne<GepItemsData>(query);
 }
Exemple #11
0
 /// <summary>
 /// Export 사이트 뷰
 /// </summary>
 /// <param name="query">조건</param>
 /// <returns></returns>
 public ExportSite ExportSiteView(QueryComplete query)
 {
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "export_site");
     return MongoHelper.FindOne<ExportSite>(query);
 }
Exemple #12
0
 /// <summary>
 /// Export 사이트 리스트
 /// </summary>
 /// <param name="query">조건</param>
 /// <returns></returns>
 public IQueryable<ExportSite> ExportSiteList(QueryComplete query)
 {
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "export_site");
     return MongoHelper.Find<ExportSite>(query);
 }
 public QueryNotConditionList ElemMatch(
     QueryComplete query
 )
 {
     conditions.Add("$elemMatch", query.ToBsonDocument());
     return this;
 }
Exemple #14
0
 public void ExportSiteRemove(QueryComplete query)
 {
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "export_site");
     MongoHelper.Remove(query);
 }
 public QueryNotConditionList ElemMatch(
     QueryComplete query
 )
 {
     return new QueryNotConditionList(name, "$elemMatch", query.ToBsonDocument());
 }
Exemple #16
0
 /// <summary>
 /// 根据条件获取内容数量的公共方法
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public static long getContentListCount(QueryComplete qc)
 {
     try
     {
         return MongoDBHelper.GetCount(PublicContent.GetCollectionName(), qc);
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Exemple #17
0
 /// <summary>
 /// 필수선택 임시저장하여 만들어졌던 S1 상품 삭제
 /// </summary>
 public void DeleteSelection(QueryComplete query)
 {
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper(dataBase, collection);
     MongoHelper.Remove(query);
 }
Exemple #18
0
		/// <summary>
		/// Generates a $match pipeline command based upon the given query
		/// </summary>
		/// <param name="query">The query used to filter the pipeline document</param>
		public static BsonDocument Match(QueryComplete query) {
			return new BsonDocument("$match", query.ToBsonDocument());
		}
 public ExpressionTreeElement(QueryComplete query)
 {
     _query = query;
 }
 /// <summary>
 /// Adds an $elemMatch test to the query.
 /// </summary>
 /// <param name="name">The name of the element to test.</param>
 /// <param name="query">The query to match elements with.</param>
 /// <returns>The builder (so method calls can be chained).</returns>
 public static QueryConditionList ElemMatch(
     string name,
     QueryComplete query
 ) {
     return new QueryConditionList(name).ElemMatch(query);
 }
Exemple #21
0
 /// <summary>
 /// eBay 상품 리스트 조회 (페이징)
 /// </summary>
 /// <param name="page"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public MongoPagingResult<eBayItemsData> List(int page, QueryComplete query)
 {
     SortByBuilder sort = SortBy.Descending("_id");
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper(dataBase, collection);
     return MongoHelper.FindByPaging<eBayItemsData>(query, 10, (10 * (page - 1)), sort);
 }
Exemple #22
0
 /// <summary>
 /// eBay 상품 리스트 조회
 /// </summary>
 public IQueryable<eBayItemsData> List(QueryComplete query)
 {
     return new GEPMongoDacHelper(dataBase, collection).Find<eBayItemsData>(query);
 }
Exemple #23
0
 /// <summary>
 /// Adds an $elemMatch test to the query.
 /// </summary>
 /// <param name="query">The query to match elements with.</param>
 /// <returns>The builder (so method calls can be chained).</returns>
 public QueryNotConditionList ElemMatch(
     QueryComplete query
     )
 {
     return(new QueryNotConditionList(name, "$elemMatch", query.ToBsonDocument()));
 }