UpdateOptions.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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;
  16. using System.Collections.Generic;
  17. using System.Linq;
  18. using System.Text;
  19. using System.Threading.Tasks;
  20. using MongoDB.Driver.Core.Misc;
  21. using MongoDB.Driver.Core.Operations;
  22. namespace MongoDB.Driver
  23. {
  24. /// <summary>
  25. /// Options for updating a single document.
  26. /// </summary>
  27. public sealed class UpdateOptions
  28. {
  29. // fields
  30. private IEnumerable<ArrayFilterDefinition> _arrayFilters;
  31. private bool? _bypassDocumentValidation;
  32. private Collation _collation;
  33. private bool _isUpsert;
  34. // properties
  35. /// <summary>
  36. /// Gets or sets the array filters.
  37. /// </summary>
  38. /// <value>
  39. /// The array filters.
  40. /// </value>
  41. public IEnumerable<ArrayFilterDefinition> ArrayFilters
  42. {
  43. get { return _arrayFilters; }
  44. set { _arrayFilters = value; }
  45. }
  46. /// <summary>
  47. /// Gets or sets a value indicating whether to bypass document validation.
  48. /// </summary>
  49. public bool? BypassDocumentValidation
  50. {
  51. get { return _bypassDocumentValidation; }
  52. set { _bypassDocumentValidation = value; }
  53. }
  54. /// <summary>
  55. /// Gets or sets the collation.
  56. /// </summary>
  57. public Collation Collation
  58. {
  59. get { return _collation; }
  60. set { _collation = value; }
  61. }
  62. /// <summary>
  63. /// Gets or sets a value indicating whether to insert the document if it doesn't already exist.
  64. /// </summary>
  65. public bool IsUpsert
  66. {
  67. get { return _isUpsert; }
  68. set { _isUpsert = value; }
  69. }
  70. }
  71. }