Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested dictionary is inserted as string #1

Open
truemetal opened this issue Mar 22, 2017 · 1 comment
Open

Nested dictionary is inserted as string #1

truemetal opened this issue Mar 22, 2017 · 1 comment

Comments

@truemetal
Copy link

truemetal commented Mar 22, 2017

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.

@TheSantaClaus
Copy link
Contributor

Same for Arrays...

TheSantaClaus added a commit to TheSantaClaus/MongoDB-StORM that referenced this issue Nov 5, 2017
iamjono added a commit that referenced this issue Nov 11, 2017
Fixed some ObjectId related issues and #1 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants