db.collections() cuts collection name when it's the same as the database

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.26
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using db.collections(), if the name of the collection starts with the name of the database, and then a dot, this is cut out of the results. E.g. collection "test.foo" is returned as "foo" if the database name is "test".

      I'm using the mongodb package version "^2.2.24". My underlying mongo server running locally has three collections:

      > use test
      switched to db test
      
      > show collections
      bar.movie
      foo.movie
      test.movie
      

      When I use db.collections() this is the result I get back

      bar.movie
      foo.movie
      movie
      

      Attached is the script I used to reproduce the issue (given a running mongo server with collections in it, as described above).

              Assignee:
              Matt Broadstone
              Reporter:
              Claudia Minardi
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: