Core Server
  1. Core Server
  2. SERVER-445

Can't reference collection names beginning with an underscore in the mongo shell

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor - P4 Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: 1.1.3
    • Fix Version/s: Planning Bucket C
    • Component/s: Shell
    • Labels:
      None
    • Environment:
      linux
    • Backport:
      No
    • # Replies:
      12
    • Last comment by Customer:
      true

      Description

      1. according to the MongoDB FAQ, collection names can begin with an underscore, but in mongo shell it results in

      MongoDB shell version: 1.1.3
      > db._a.insert({a: 1});
      Sun Nov 29 14:19:16 JS Error: TypeError: db._a has no properties (shell):0
      > db._a.findOne();
      Sun Nov 29 14:19:36 JS Error: TypeError: db._a has no properties (shell):0
      
      while
      > db.a.insert({a: 1});
      > db.a.findOne();
      { "_id" : ObjectId("4b1274ce2da8fd0af74f3a1c"), "a" : 1 }
      

      2. When inserting document with PHP driver it works

      3. I also tried mongodb-linux-i686-2009-11-29 nightly with the same result

        Activity

        Hide
        Antoine Girbal
        added a comment -

        what behavior do you want?
        we can make it look for variable and if none exist then consider it a collection.

        Show
        Antoine Girbal
        added a comment - what behavior do you want? we can make it look for variable and if none exist then consider it a collection.
        Hide
        Eliot Horowitz
        added a comment -

        Not sure - this is why its in planned bucket b - shouldn't work on right now

        Show
        Eliot Horowitz
        added a comment - Not sure - this is why its in planned bucket b - shouldn't work on right now
        Hide
        auto
        added a comment -

        Author:

        {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

        Message: - SERVER-4025: segv in V8 when certain special objects (e.g. DBCollection) are converted from JS to BSON

        Show
        auto
        added a comment - Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'} Message: - SERVER-4025 : segv in V8 when certain special objects (e.g. DBCollection) are converted from JS to BSON SERVER-445 : cleaner code in v8 Branch: master https://github.com/mongodb/mongo/commit/ba817fbd9acb69d3a252ff4da88315263ed0432d
        Hide
        MattyG
        added a comment -

        This bug is still present. Can anyone tell me why the leading underscore semantic is special? When/where is is used etc?

        Show
        MattyG
        added a comment - This bug is still present. Can anyone tell me why the leading underscore semantic is special? When/where is is used etc?
        Hide
        Shawn Welch
        added a comment - - edited

        Still not working. Why not?

        Yo: http://docs.mongodb.org/manual/reference/limits/#Restriction on Collection Names

        Wudupwidit? Now I can't even drop the stupid collection.

        Show
        Shawn Welch
        added a comment - - edited Still not working. Why not? Yo: http://docs.mongodb.org/manual/reference/limits/#Restriction on Collection Names Wudupwidit? Now I can't even drop the stupid collection.

          People

          • Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since reply:
              7 weeks, 1 day ago
              Date of 1st Reply: