bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 165 forks source link

Genghis can't handle map keys with dots #210

Open Scorpiion opened 9 years ago

Scorpiion commented 9 years ago

Genghis can't handle a map with keys containing dots (".").

You can insert a new document like this:

{
    system_roles: {
        user: {
            "AppsRpc.Insert": true,
            "AppsRpc.List": true
        }
    }
}

And you can view the documents as usual.

But then if you try to edit the document you get this error:

PHP error: Undefined property: MongoWriteConcernException::$doc

I looked at the request payload for the update, and it looks good, so I think the bug is in the php code that updates a document:

{"_id":{"$genghisType":"ObjectId","$value":"55f7e06833eca8e6068b4583"},"system_roles":{"user":{"AppsRpc.Insert":true,"AppsRpc.List":false}}}

Do you think there is an easy fix for this @bobthecow or is it more complicated?