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

Option to save list or entity as DBRef

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.5
    • Serialization
    • None

    Description

      Some kind of mapping that tells driver to store a document reference instead of plain document.

      Example

                  map.MapMember(x => x.UserOwner /*one user*/)
                      .SetIsReference("Users" /*collectionName*/)
                      .SetIsRequired(true);
       
                  map.MapMember(x => x.AssociatedProfiles /* many profiles */)
                      .SetIsReference("Profiles" /*collectionName*/)
                      .SetIsRequired(true);
      

      UserOwner returns User instead of MongoDBRef
      AssociatedProfiles returns IList<Profile> (instead of MongoDBRef[])

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            junalmeida Marcos Almeida Jr.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: