BulkWriteOptions.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright 2010-present 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.Collections.Generic;
  16. using System.Linq;
  17. using MongoDB.Driver.Core.Misc;
  18. namespace MongoDB.Driver
  19. {
  20. /// <summary>
  21. /// Options for a bulk write operation.
  22. /// </summary>
  23. public sealed class BulkWriteOptions
  24. {
  25. // fields
  26. private bool? _bypassDocumentValidation;
  27. private bool _isOrdered;
  28. // constructors
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="BulkWriteOptions"/> class.
  31. /// </summary>
  32. public BulkWriteOptions()
  33. {
  34. _isOrdered = true;
  35. }
  36. // properties
  37. /// <summary>
  38. /// Gets or sets a value indicating whether to bypass document validation.
  39. /// </summary>
  40. public bool? BypassDocumentValidation
  41. {
  42. get { return _bypassDocumentValidation; }
  43. set { _bypassDocumentValidation = value; }
  44. }
  45. /// <summary>
  46. /// Gets or sets a value indicating whether the requests are fulfilled in order.
  47. /// </summary>
  48. public bool IsOrdered
  49. {
  50. get { return _isOrdered; }
  51. set { _isOrdered = value; }
  52. }
  53. }
  54. }