BsonElement attribute is ignored on Id properties

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Serialization
    • None
    • None
    • Dotnet Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      It seems that the `BsonElement` attribute is ignored on properties called "Id". I think this could happen because of our automatic 

      For example :

      var pipeline = new EmptyPipelineDefinition<Movie> ()
          .Project(
              Builders<Movie>.Projection
                  .Exclude(m => m.Id)
          );
      
      public class Movie
      {
          [BsonElement("notId")]
          public ObjectId Id { get; set; }
      }

      This will render to

      { "$project" :{ "_id" : 0 }}

      instead of 

      { "$project" :{ "notId" : 0 }}

            Assignee:
            Unassigned
            Reporter:
            Ferdinando Papale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: