How can I use a variable as the name parameter in an object?
var field = 'profile.email'
var value = '[email protected]'
var query = { field : value };
console.log(query);
Current output:
{ field : '[email protected]' }
Output I want to achieve:
{ 'profile.email' : '[email protected]' }