As you can see, it's almost like the first one. The only difference is that it creates a new { hello: 'world' } object and assigns it to test variable each time. So collection.insert will get same data in both of your code examples.

I believe the problem is somewhere in the code you didn't provide here.