Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42019

shorthand syntax for checking if _id value is missing

    XMLWordPrintable

Details

    • New Feature
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      In pipeline update specification it is common to check if a field doesn't exist and the way to tell if you're doing an upsert would be to check if _id doesn't exist. I'm proposing a shorthand syntax expression $onInsert or ifUpsert (exact work TBD) which would be short for:

       {$eq:[ {$type:"$_id"}, "missing" ] } 

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: