I've this:
var tmp = "Test";
and want that:
Books.update({_id: data._id},{$set:{tmp: [0,0,0,0,0]}});
Now I get an array like this: tmp: [0,0,0,0,0] But I want that: Test [0,0,0,0,0]
Have somebody an idea how I can do that?
var tmp = "Test",
set = {};
set[tmp] = [0,0,0,0,0];
Books.update({_id: data._id},{$set: set});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With