Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4147

Use false for null foreign references

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 5.0.0
    • Fix Version/s: 6.0.0
    • Component/s: None
    • Labels:
      None

      Description

      It would be great to be able to specify a foreign reference as as value other than null. False would be fine, but the option to set it when defining the relation would also work.

      Why?

      When you want to query on a foreign reference for null, i.e. give me all of these documents that DONT have a relation set, you have to query against null or $exists: false. This doesn't perform too great in a lot of circumstances. Being able to query against false (or anything other than null) would solve this.

      Related to: https://jira.mongodb.org/browse/SERVER-18653

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            matt@trak.io Matthew Spence
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: