AggregateFluentBase.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /* Copyright 2010-2016 MongoDB Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. using System;
  16. using System.Collections.Generic;
  17. using System.Threading;
  18. using System.Threading.Tasks;
  19. using MongoDB.Bson;
  20. using MongoDB.Bson.Serialization;
  21. namespace MongoDB.Driver
  22. {
  23. /// <summary>
  24. /// Base class for implementors of <see cref="IAggregateFluent{TResult}" />.
  25. /// </summary>
  26. /// <typeparam name="TResult">The type of the document.</typeparam>
  27. public abstract class AggregateFluentBase<TResult> : IOrderedAggregateFluent<TResult>
  28. {
  29. /// <inheritdoc />
  30. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
  31. public virtual IMongoDatabase Database
  32. {
  33. get { throw new NotImplementedException(); }
  34. }
  35. /// <inheritdoc />
  36. public abstract AggregateOptions Options { get; }
  37. /// <inheritdoc />
  38. public abstract IList<IPipelineStageDefinition> Stages { get; }
  39. /// <inheritdoc />
  40. public abstract IAggregateFluent<TNewResult> AppendStage<TNewResult>(PipelineStageDefinition<TResult, TNewResult> stage);
  41. /// <inheritdoc />
  42. public abstract IAggregateFluent<TNewResult> As<TNewResult>(IBsonSerializer<TNewResult> newResultSerializer);
  43. /// <inheritdoc />
  44. public virtual IAggregateFluent<AggregateBucketResult<TValue>> Bucket<TValue>(
  45. AggregateExpressionDefinition<TResult, TValue> groupBy,
  46. IEnumerable<TValue> boundaries,
  47. AggregateBucketOptions<TValue> options = null)
  48. {
  49. throw new NotImplementedException();
  50. }
  51. /// <inheritdoc />
  52. public virtual IAggregateFluent<TNewResult> Bucket<TValue, TNewResult>(
  53. AggregateExpressionDefinition<TResult, TValue> groupBy,
  54. IEnumerable<TValue> boundaries,
  55. ProjectionDefinition<TResult, TNewResult> output,
  56. AggregateBucketOptions<TValue> options = null)
  57. {
  58. throw new NotImplementedException();
  59. }
  60. /// <inheritdoc />
  61. public virtual IAggregateFluent<AggregateBucketAutoResult<TValue>> BucketAuto<TValue>(
  62. AggregateExpressionDefinition<TResult, TValue> groupBy,
  63. int buckets,
  64. AggregateBucketAutoOptions options = null)
  65. {
  66. throw new NotImplementedException();
  67. }
  68. /// <inheritdoc />
  69. public virtual IAggregateFluent<TNewResult> BucketAuto<TValue, TNewResult>(
  70. AggregateExpressionDefinition<TResult, TValue> groupBy,
  71. int buckets,
  72. ProjectionDefinition<TResult, TNewResult> output,
  73. AggregateBucketAutoOptions options = null)
  74. {
  75. throw new NotImplementedException();
  76. }
  77. /// <inheritdoc />
  78. public virtual IAggregateFluent<AggregateCountResult> Count()
  79. {
  80. throw new NotImplementedException();
  81. }
  82. /// <inheritdoc />
  83. public virtual IAggregateFluent<TNewResult> Facet<TNewResult>(
  84. IEnumerable<AggregateFacet<TResult>> facets,
  85. AggregateFacetOptions<TNewResult> options = null)
  86. {
  87. throw new NotImplementedException();
  88. }
  89. /// <inheritdoc />
  90. public virtual IAggregateFluent<TNewResult> GraphLookup<TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult>(
  91. IMongoCollection<TFrom> from,
  92. FieldDefinition<TFrom, TConnectFrom> connectFromField,
  93. FieldDefinition<TFrom, TConnectTo> connectToField,
  94. AggregateExpressionDefinition<TResult, TStartWith> startWith,
  95. FieldDefinition<TNewResult, TAs> @as,
  96. FieldDefinition<TAsElement, int> depthField,
  97. AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult> options = null)
  98. where TAs : IEnumerable<TAsElement>
  99. {
  100. throw new NotImplementedException();
  101. }
  102. /// <inheritdoc />
  103. public abstract IAggregateFluent<TNewResult> Group<TNewResult>(ProjectionDefinition<TResult, TNewResult> group);
  104. /// <inheritdoc />
  105. public abstract IAggregateFluent<TResult> Limit(int limit);
  106. /// <inheritdoc />
  107. public virtual IAggregateFluent<TNewResult> Lookup<TForeignDocument, TNewResult>(string foreignCollectionName, FieldDefinition<TResult> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TNewResult> @as, AggregateLookupOptions<TForeignDocument, TNewResult> options)
  108. {
  109. throw new NotImplementedException();
  110. }
  111. /// <inheritdoc />
  112. public abstract IAggregateFluent<TResult> Match(FilterDefinition<TResult> filter);
  113. /// <inheritdoc />
  114. public abstract IAggregateFluent<TNewResult> OfType<TNewResult>(IBsonSerializer<TNewResult> newResultSerializer) where TNewResult : TResult;
  115. /// <inheritdoc />
  116. public virtual IAsyncCursor<TResult> Out(string collectionName, CancellationToken cancellationToken)
  117. {
  118. throw new NotImplementedException();
  119. }
  120. /// <inheritdoc />
  121. public abstract Task<IAsyncCursor<TResult>> OutAsync(string collectionName, CancellationToken cancellationToken);
  122. /// <inheritdoc />
  123. public abstract IAggregateFluent<TNewResult> Project<TNewResult>(ProjectionDefinition<TResult, TNewResult> projection);
  124. /// <inheritdoc />
  125. public virtual IAggregateFluent<TNewResult> ReplaceRoot<TNewResult>(AggregateExpressionDefinition<TResult, TNewResult> newRoot)
  126. {
  127. throw new NotImplementedException();
  128. }
  129. /// <inheritdoc />
  130. public abstract IAggregateFluent<TResult> Skip(int skip);
  131. /// <inheritdoc />
  132. public abstract IAggregateFluent<TResult> Sort(SortDefinition<TResult> sort);
  133. /// <inheritdoc />
  134. public virtual IAggregateFluent<AggregateSortByCountResult<TId>> SortByCount<TId>(AggregateExpressionDefinition<TResult, TId> id)
  135. {
  136. throw new NotImplementedException();
  137. }
  138. /// <inheritdoc />
  139. public virtual IOrderedAggregateFluent<TResult> ThenBy(SortDefinition<TResult> newSort)
  140. {
  141. throw new NotImplementedException();
  142. }
  143. /// <inheritdoc />
  144. public abstract IAggregateFluent<TNewResult> Unwind<TNewResult>(FieldDefinition<TResult> field, IBsonSerializer<TNewResult> newResultSerializer);
  145. /// <inheritdoc />
  146. public virtual IAggregateFluent<TNewResult> Unwind<TNewResult>(FieldDefinition<TResult> field, AggregateUnwindOptions<TNewResult> options)
  147. {
  148. throw new NotImplementedException();
  149. }
  150. /// <inheritdoc />
  151. public virtual IAsyncCursor<TResult> ToCursor(CancellationToken cancellationToken)
  152. {
  153. throw new NotImplementedException();
  154. }
  155. /// <inheritdoc />
  156. public abstract Task<IAsyncCursor<TResult>> ToCursorAsync(CancellationToken cancellationToken);
  157. }
  158. }