craiggwilson / Simple.Data.MongoDB

MongoDB adapter for Simple.Data
35 stars 10 forks source link

Can't insert arrays #5

Closed chriszero closed 12 years ago

chriszero commented 12 years ago

Hello,

It's not possible to insert arrays, there will be remain "Empty" Example:

dynamic db = Database.Opener.OpenMongo("mongodb://localhost:27017/test");
var res = db.Foo.Insert(TimeStamp: item.Timestamp, Sensors: new List<int> { 1, 2, 3 });

res.Sensors will be "Empty" res.TimeStamp is set

Nothing is inserted into "Foo"

craiggwilson commented 12 years ago

At first I didn't believe you cause I have tests. Then I looked at the tests and don't have a test for arrays... :( I know you can read arrays/lists back out, but apparently never test them going in.

I'll try and look at this shortly.

timhall commented 12 years ago

I've just run into this issue too and this functionality seems pretty important, so *bump. Great adapter for a great library, thanks!

craiggwilson commented 12 years ago

I'm having trouble reproducing this. Can someone write a failing test for me?

timhall commented 12 years ago

I'll see what I can do. Be forewarned, I'm a little green, but I'll give it a good effort

timhall commented 12 years ago

So after some tinkering, I can't reproduce it again... Must have been doing something wrong the other day and stopped once I saw this open issue. I'm satisfied with the checks you added to the insert test and it seems to be working now so I vote you close this issue. Thanks again for the adapter!