@@ -156,6 +156,28 @@ public static UpdateBuilder BitwiseOr(string name, long value)
156
156
return new UpdateBuilder ( ) . BitwiseOr ( name , value ) ;
157
157
}
158
158
159
+ /// <summary>
160
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
161
+ /// </summary>
162
+ /// <param name="name">The name of the element to be modified.</param>
163
+ /// <param name="value">The value to be xor-ed with the current value.</param>
164
+ /// <returns>The builder (so method calls can be chained).</returns>
165
+ public static UpdateBuilder BitwiseXor ( string name , int value )
166
+ {
167
+ return new UpdateBuilder ( ) . BitwiseXor ( name , value ) ;
168
+ }
169
+
170
+ /// <summary>
171
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
172
+ /// </summary>
173
+ /// <param name="name">The name of the element to be modified.</param>
174
+ /// <param name="value">The value to be xor-ed with the current value.</param>
175
+ /// <returns>The builder (so method calls can be chained).</returns>
176
+ public static UpdateBuilder BitwiseXor ( string name , long value )
177
+ {
178
+ return new UpdateBuilder ( ) . BitwiseXor ( name , value ) ;
179
+ }
180
+
159
181
/// <summary>
160
182
/// Combines several UpdateBuilders into a single UpdateBuilder.
161
183
/// </summary>
@@ -853,6 +875,32 @@ public UpdateBuilder BitwiseOr(string name, long value)
853
875
return this ;
854
876
}
855
877
878
+ /// <summary>
879
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
880
+ /// </summary>
881
+ /// <param name="name">The name of the element to be modified.</param>
882
+ /// <param name="value">The value to be xor-ed with the current value.</param>
883
+ /// <returns>The builder (so method calls can be chained).</returns>
884
+ public UpdateBuilder BitwiseXor ( string name , int value )
885
+ {
886
+ if ( name == null ) { throw new ArgumentNullException ( "name" ) ; }
887
+ BitwiseOperation ( name , "xor" , value ) ;
888
+ return this ;
889
+ }
890
+
891
+ /// <summary>
892
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
893
+ /// </summary>
894
+ /// <param name="name">The name of the element to be modified.</param>
895
+ /// <param name="value">The value to be xor-ed with the current value.</param>
896
+ /// <returns>The builder (so method calls can be chained).</returns>
897
+ public UpdateBuilder BitwiseXor ( string name , long value )
898
+ {
899
+ if ( name == null ) { throw new ArgumentNullException ( "name" ) ; }
900
+ BitwiseOperation ( name , "xor" , value ) ;
901
+ return this ;
902
+ }
903
+
856
904
/// <summary>
857
905
/// Combines another UpdateBuilder into this one.
858
906
/// </summary>
@@ -1752,6 +1800,32 @@ public static UpdateBuilder<TDocument> BitwiseOr(Expression<Func<TDocument, long
1752
1800
return new UpdateBuilder < TDocument > ( ) . BitwiseOr ( memberExpression , value ) ;
1753
1801
}
1754
1802
1803
+ /// <summary>
1804
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
1805
+ /// </summary>
1806
+ /// <param name="memberExpression">The member expression.</param>
1807
+ /// <param name="value">The value to be xor-ed with the current value.</param>
1808
+ /// <returns>
1809
+ /// The builder (so method calls can be chained).
1810
+ /// </returns>
1811
+ public static UpdateBuilder < TDocument > BitwiseXor ( Expression < Func < TDocument , int > > memberExpression , int value )
1812
+ {
1813
+ return new UpdateBuilder < TDocument > ( ) . BitwiseXor ( memberExpression , value ) ;
1814
+ }
1815
+
1816
+ /// <summary>
1817
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
1818
+ /// </summary>
1819
+ /// <param name="memberExpression">The member expression.</param>
1820
+ /// <param name="value">The value to be xor-ed with the current value.</param>
1821
+ /// <returns>
1822
+ /// The builder (so method calls can be chained).
1823
+ /// </returns>
1824
+ public static UpdateBuilder < TDocument > BitwiseXor ( Expression < Func < TDocument , long > > memberExpression , long value )
1825
+ {
1826
+ return new UpdateBuilder < TDocument > ( ) . BitwiseXor ( memberExpression , value ) ;
1827
+ }
1828
+
1755
1829
/// <summary>
1756
1830
/// Combines several UpdateBuilders into a single UpdateBuilder.
1757
1831
/// </summary>
@@ -2215,7 +2289,7 @@ public UpdateBuilder<TDocument> BitwiseOr(Expression<Func<TDocument, int>> membe
2215
2289
/// Sets the named element to the bitwise or of its value with another value (see $bit with "or").
2216
2290
/// </summary>
2217
2291
/// <param name="memberExpression">The member expression.</param>
2218
- /// <param name="value">The value to be and -ed with the current value.</param>
2292
+ /// <param name="value">The value to be or -ed with the current value.</param>
2219
2293
/// <returns>
2220
2294
/// The builder (so method calls can be chained).
2221
2295
/// </returns>
@@ -2232,6 +2306,48 @@ public UpdateBuilder<TDocument> BitwiseOr(Expression<Func<TDocument, long>> memb
2232
2306
return this ;
2233
2307
}
2234
2308
2309
+ /// <summary>
2310
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
2311
+ /// </summary>
2312
+ /// <param name="memberExpression">The member expression.</param>
2313
+ /// <param name="value">The value to be xor-ed with the current value.</param>
2314
+ /// <returns>
2315
+ /// The builder (so method calls can be chained).
2316
+ /// </returns>
2317
+ public UpdateBuilder < TDocument > BitwiseXor ( Expression < Func < TDocument , int > > memberExpression , int value )
2318
+ {
2319
+ if ( memberExpression == null )
2320
+ {
2321
+ throw new ArgumentNullException ( "memberExpression" ) ;
2322
+ }
2323
+
2324
+ var serializationInfo = _serializationInfoHelper . GetSerializationInfo ( memberExpression ) ;
2325
+ var serializedValue = _serializationInfoHelper . SerializeValue ( serializationInfo , value ) ;
2326
+ _updateBuilder = _updateBuilder . BitwiseXor ( serializationInfo . ElementName , value ) ;
2327
+ return this ;
2328
+ }
2329
+
2330
+ /// <summary>
2331
+ /// Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
2332
+ /// </summary>
2333
+ /// <param name="memberExpression">The member expression.</param>
2334
+ /// <param name="value">The value to be xor-ed with the current value.</param>
2335
+ /// <returns>
2336
+ /// The builder (so method calls can be chained).
2337
+ /// </returns>
2338
+ public UpdateBuilder < TDocument > BitwiseXor ( Expression < Func < TDocument , long > > memberExpression , long value )
2339
+ {
2340
+ if ( memberExpression == null )
2341
+ {
2342
+ throw new ArgumentNullException ( "memberExpression" ) ;
2343
+ }
2344
+
2345
+ var serializationInfo = _serializationInfoHelper . GetSerializationInfo ( memberExpression ) ;
2346
+ var serializedValue = _serializationInfoHelper . SerializeValue ( serializationInfo , value ) ;
2347
+ _updateBuilder = _updateBuilder . BitwiseXor ( serializationInfo . ElementName , value ) ;
2348
+ return this ;
2349
+ }
2350
+
2235
2351
/// <summary>
2236
2352
/// Combines another UpdateBuilder into this one.
2237
2353
/// </summary>
0 commit comments