Skip to content

Commit 21c2699

Browse files
author
Hugo Bonacci
committed
Changed name of Append to AppendParameter to make it sounds less like it does anything to the documents being queried.
1 parent 3c7c673 commit 21c2699

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Query/MongoQuery.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public MongoQuery(MongoDatabase database, string collection)
4949
/// <summary>
5050
/// Allows you to append a query option using the Mongo syntax
5151
/// </summary>
52-
public MongoQuery Append(string field, string modifier, object value) {
52+
public MongoQuery AppendParameter(string field, string modifier, object value) {
5353

5454
//make sure there is a field available
5555
if (!(this._Parameters[field] is BsonDocument)) {
@@ -99,7 +99,7 @@ public MongoQuery Where(string script, bool wrapWithFunction) {
9999
/// Finds all records that match the provided expression
100100
/// </summary>
101101
public MongoQuery Match(string field, Regex expression) {
102-
return this.Append(field, null, expression);
102+
return this.AppendParameter(field, null, expression);
103103
}
104104

105105
/// <summary>
@@ -127,7 +127,7 @@ public MongoQuery EqualTo(string field, object value) {
127127
}
128128

129129
//otherwise, just do the default step
130-
return this.Append(field, null, value);
130+
return this.AppendParameter(field, null, value);
131131

132132
}
133133

@@ -161,49 +161,49 @@ public MongoQuery FindById(MongoOid id) {
161161
/// Finds all records that are not equal to the value provided
162162
/// </summary>
163163
public MongoQuery NotEqualTo(string field, object value) {
164-
return this.Append(field, "$ne", value);
164+
return this.AppendParameter(field, "$ne", value);
165165
}
166166

167167
/// <summary>
168168
/// Finds all records greater than or equal to the provided value
169169
/// </summary>
170170
public MongoQuery GreaterOrEqual(string field, object value) {
171-
return this.Append(field, "$gte", value);
171+
return this.AppendParameter(field, "$gte", value);
172172
}
173173

174174
/// <summary>
175175
/// Finds all records greater than the provided value
176176
/// </summary>
177177
public MongoQuery Greater(string field, object value) {
178-
return this.Append(field, "$gt", value);
178+
return this.AppendParameter(field, "$gt", value);
179179
}
180180

181181
/// <summary>
182182
/// Finds all records less than or equal to the provided value
183183
/// </summary>
184184
public MongoQuery LessOrEqual(string field, object value) {
185-
return this.Append(field, "$lte", value);
185+
return this.AppendParameter(field, "$lte", value);
186186
}
187187

188188
/// <summary>
189189
/// Finds all records less than the provided value
190190
/// </summary>
191191
public MongoQuery Less(string field, object value) {
192-
return this.Append(field, "$lt", value);
192+
return this.AppendParameter(field, "$lt", value);
193193
}
194194

195195
/// <summary>
196196
/// Finds records that the requested field exists in
197197
/// </summary>
198198
public MongoQuery Exists(string field) {
199-
return this.Append(field, "$exists", true);
199+
return this.AppendParameter(field, "$exists", true);
200200
}
201201

202202
/// <summary>
203203
/// Finds records that the requested field does not exist in
204204
/// </summary>
205205
public MongoQuery NotExists(string field) {
206-
return this.Append(field, "$exists", false);
206+
return this.AppendParameter(field, "$exists", false);
207207
}
208208

209209
/// <summary>
@@ -217,7 +217,7 @@ public MongoQuery In(string field, IEnumerable values) {
217217
/// Finds fields that match any value within the record
218218
/// </summary>
219219
public MongoQuery In(string field, params object[] values) {
220-
return this.Append(field, "$in", values);
220+
return this.AppendParameter(field, "$in", values);
221221
}
222222

223223
/// <summary>
@@ -231,14 +231,14 @@ public MongoQuery NotIn(string field, IEnumerable values) {
231231
/// Finds fields that haven't any matches within the array
232232
/// </summary>
233233
public MongoQuery NotIn(string field, params object[] values) {
234-
return this.Append(field, "$nin", values);
234+
return this.AppendParameter(field, "$nin", values);
235235
}
236236

237237
/// <summary>
238238
/// Finds fields that match all value within the record
239239
/// </summary>
240240
public MongoQuery Size(string field, int size) {
241-
return this.Append(field, "$size", size);
241+
return this.AppendParameter(field, "$size", size);
242242
}
243243

244244
/// <summary>
@@ -252,7 +252,7 @@ public MongoQuery All(string field, IEnumerable values) {
252252
/// Finds fields that match all value within the record
253253
/// </summary>
254254
public MongoQuery All(string field, params object[] values) {
255-
return this.Append(field, "$all", values);
255+
return this.AppendParameter(field, "$all", values);
256256
}
257257

258258
/// <summary>
@@ -266,7 +266,7 @@ public MongoQuery Mod(string field, int value) {
266266
/// Performs a modulo comparison (field % value == compare)
267267
/// </summary>
268268
public MongoQuery Mod(string field, int value, int compare) {
269-
return this.Append(field, "$mod", new int[] { value, compare});
269+
return this.AppendParameter(field, "$mod", new int[] { value, compare});
270270
}
271271

272272
#endregion

0 commit comments

Comments
 (0)