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

Create DBRefs with conventions

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.0
    • None

    Description

      Instead of polluting your model with MongoDB specific classes like MongoDBRef, you should be able to handle it via conventions. For example,
      If I have a model class with a foreign key reference like the following:
      public class Employee{
      public object Id;
      public object Manager_Id;
      }

      I can create a convention where "Manager" is the collection name and "Id" is the field to join on. When a save occurs, the driver can detect this convention and apply the $ref appropriately.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            jon.eckstein Jon Eckstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: