Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1080

unexpected change non id field name in BSON document

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.9.2, 2.0
    • Serialization
    • None

    Description

      I want to serialize following class:

      public class TestModel_CustomNotId
      {
          [BsonElement("id")]
          public ObjectId Id { get; set; }
      }

      I expected Id field to be serialized as "id",
      but the result BSON document is containing "_id" field.

      fix example:
      https://github.com/ExM/mongo-csharp-driver/commit/264d2d912d73ddad5ebb9edc91f765a03f33e450

      Attachments

        Activity

          People

            Unassigned Unassigned
            ExM Anatoliy Koperin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: