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

Return new instance of Collection from db.coll/db["coll"]

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • JavaScript, Shell
    • None
    • ALL

    Description

      Currently getting a collection from db.coll returns the same instance every time but calling db.getCollection("coll") will return a new instance every time. We should get these playing together.

      these return the same instance

      > var a = db.coll
      > var b = db.coll
      > a === b
      true
      

      these return new instances every time

      > var a = db.getCollection('coll')
      > var b = db.getCollection('coll')
      > a === b
      false
      

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: