Skip to content

Nested dictionary is inserted as string  #1

@truemetal

Description

@truemetal

Consider class declaration:

class MySubclass: MongoDBStORM
{
    var id = ""
    var title = ""
    var options = Dictionary<String, String>()
    
    override init() {
        super.init()
        _collection = "collections"
    }
}

If I do this, options are being saved as a string, not a dictionary :

let doc = MySubclass()
doc.title = "title"
doc.options = ["one" : "two"]
try doc.save()

On the other hand, it does work as intended if saving via MongoDB Package as BSONs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions