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

Use false for null foreign references

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

      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

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

              Created:
              Updated:
              Resolved: