datanoise / mongo.cr

Crystal binding for MongoDB C Driver
MIT License
97 stars 35 forks source link

Can't convert query result to array #23

Open ghost opened 7 years ago

ghost commented 7 years ago

So I inserted following data into the database:

{
    "name": "Group #1",
    "users": [
        "daniel",
        "bob"
    ]
}

But if I want to get that array back, the Result is an BSON::Code and I can't do anything with it. How could that be fixed and is there any workaround? @datanoise

elrok123 commented 7 years ago

@oltmannsdaniel If you want to convert BSON back to JSON, pretty sure you can just do .to_json no?