field name with dot contradiction

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.6.3
    • Component/s: Write Ops
    • None
    • Environment:
      ubuntu 10.04, Mac OSX
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I tried the following code in mongo-shell, but it seems contradiction :

      > db.doc.drop()
      > db.doc.save({ versions :

      { '1.1' : 0 }

      })
      Sat Oct 30 19:00:39 uncaught exception: can't have . in field names [1.1]

      > db.doc.save({})
      > doc = db.doc.findOne()
      > db.doc.update({_id : doc['_id'] }, { versions :

      { '1.1' : 0 }

      } )
      > db.doc.findOne()
      {
      "_id" : ObjectId("4ccbfb31fe8d276c4eb1b846"),
      "versions" :

      { "1.1" : 0 }

      }

      If mongo does not allow field names that have dot, then I should not allow to save in any way.

            Assignee:
            Antoine Girbal (Inactive)
            Reporter:
            Stone, Gao
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: